CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    41

    sql2000 select question

    sql2000:


    Code:
    Score_BD Table:
    
    A   B	C   D	E	F    G	   H     I	K	L
    -   -	-   -	-	-    -	   -     -	-	-	
    9   1	3   30	5	     9	  3			
    9   1	6   50	5	     9	  3
    9   1	99  40	5	8    9	  3     7	6	3
    9   1	66  21	5	7    9	  32    7	6	3
    9   1	44  19	5	9   10	  37    7	6	3
    10  1	50  20	5	     9	  3			
    10  1	49  20	5	     9	  3
    10  1	48  20	5	8    9	  3     7	6	3
    10  1	47  21	5	7    9	  33    7	6	3
    10  1	46  19	5	9   10	  34    7	6	3
    need to extract:
    G and H columns case when F is not null and A is 10.

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: sql2000 select question

    Something like:
    Code:
    SELECT G, H 
    FROM Score_BD 
    WHERE F IS NOT NULL AND A = 10
    - petter

  3. #3
    Join Date
    Jan 2003
    Location
    North Carolina
    Posts
    309

    Re: sql2000 select question

    Or if you prefer that if either condition is met as opposed to both use

    SELECT G, H
    FROM Score_BD
    WHERE F IS NOT NULL OR A = 10

  4. #4
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: sql2000 select question

    Or if you prefer that if either condition is met as opposed to both use
    Or if you prefer that if first condition is met as opposed to previous solutions
    Code:
     SELECT G, H 
    FROM Score_BD 
    WHERE F IS NOT NULL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured