Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Leiria Portugal
    Posts
    14

    Unanswered: Select just the columns that haven't NULL rows

    Hi,

    I need to build a query that just includes certain columns if they haven't NULL row values.

    For example:

    SELECT NAME_COLUMN IF not NULL, SELECT GENDER_COLUMN if not NULL, otherwise won't select these 2 columns i used as example.

    Any help, will be greatly appreciated,

    Best regards,
    Teixeira
    Last edited by Teixeira; 11-02-06 at 06:41.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you cannot do that

    when you run a query, all rows in the result set will have exactly the same columns
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    Location
    Leiria Portugal
    Posts
    14
    OK, Thanks!

    I'll make a loop cicle inside my C# code that will check the columns values and i'll construct my grid based on that!

    I wanted to minimize as much as possible the processing time of my program, because is for compact framework, and it has to be very light and fast, but i'll do this witout using just sql.

    Thanks for help,

    Teixeira

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    <sigh/> .
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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