Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6624765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:41:35+00:00 2026-05-25T21:41:35+00:00

I came across a fictitious SQL, i am not sure what is the original

  • 0

I came across a fictitious SQL, i am not sure what is the original intend, it looks like:

SELECT COUNT (*)
INTO miss
FROM billing b
WHERE b.network= network1 
and NOT EXISTS (SELECT 1 from vas NV WHERE NV.network =  
b.network);

Why is there a select 1, and not exists?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:41:36+00:00Added an answer on May 25, 2026 at 9:41 pm

    When using the EXISTS keyword you need to have a sub-select statement, and only the existence of a row is checked, the contents of the row do not matter. SELECT is a keyword that controls what is inside the columns that are returned. SELECTing 1 or NV.network will return the same number of rows.

    Therefore you can SELECT whatever you want, and canonical ways to do that include SELECT NULL or SELECT 1.

    Note that an alternative to your query is:

    SELECT count(*) INTO miss
      FROM billing b
      LEFT JOIN vas NV ON NV.network = b.network
     WHERE b.network = network1
       AND NV.network IS NULL
    

    (left join fills right-hand columns with NULL values when the ON condition cannot be matched.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across a piece of code which looks like this: jQuery(function($) { $('#saySomething').click(function()
Came across something like this today, and was wondering if there was an equivalent
I came across this Linq to Sql code in an application I am maintaining:
I came across a shell script that contains a statement like, if [ $val
I came across this puzzle from centerofmath.org via Twitter: There is a ten-digit number
I came across this kind of situation but could not resolve, any hint would
Came across code recently in Wicket like so: Form<?> form = new Form<Void>(form) Can
Came across this implementation of FxAA from NVidia. http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf http://timothylottes.blogspot.in/2011/12/fxaa-40-stills-and-features.html The source code as
I came across this syntax which i have not seen before struct A {
I came across an interface recently that only defined a setter like so: public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.