Results 1 to 3 of 3

Thread: best way to select data

Threaded View

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    best way to select data

    In my table A I have columns like
    UniversityN, AstComposition, BstComposition, AstHall, BstHall, ContinueFee, DepositComposition all the value either is 'on' or 'Null'
    if I want to select those data the have value in AstComposition, BstComposition, ContinueFee, DepositComposition or in AstHall, BstHall
    and group by University Number , is a better way to do it ??

    meantime I use
    Code:
    select * from table A
    where and AstComposition='on'
    
    union all
    select * from table A
    and AstComposition !='on' and BstComposition='on'
    union all
    select * from table A
    and AstComposition !='on' and BstComposition!='on' and ContinueFee ='on'
    union all
    select * from table A
    and AstComposition !='on' and BstComposition!='on' and ContinueFee !='on' and DepositComposition='on'
    is that a better way to do the select ???
    ________
    Vapor Genie
    Last edited by sql; 03-06-2011 at 02:16 AM.

Posting Permissions

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