Thread: Columns display

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    USA
    Posts
    1
    Rep Power
    0

    Columns display


    i have columns in table like

    A B C D E F
    1 4 2 0 1 0
    3 5 6 0 5 0
    6 6 5 0 4 0

    i need to display only those colums which has values lik

    A B C E
    1 4 2 1
    3 5 6 5
    6 6 5 4

    how can i do it
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    Manchester, UK
    Posts
    23
    Rep Power
    0
    select a,b,c,e from your_table
    where not d = 0 and not f = 0

    Hope this helps,

    Gerrit-Jan Linker
    www.oraxcel.com
    Home of SQL*XL:Linking Excel to databases
  4. #3
  5. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,027
    Rep Power
    4210
    "only those colums which has values"

    it is not possible to pre-determine which columns to select until after the entire table has been scanned for values in each column

    for example, suppose the table had the following values --

    A B C D E F
    1 4 2 0 1 0
    3 5 6 0 5 0
    6 6 5 0 4 0
    9 0 2 1 0 0
    0 4 9 0 3 1

    now every column has a value!!

    rudy
    http://r937.com/

IMN logo majestic logo threadwatch logo seochat tools logo