-
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
-
Forum Rules
|
|