krisyash
asked on
Help
Please help me with a sql query. I have a view with couple of joined tables which displays the results as
Name, Top, Bottom and some other fields. The results looks like
AA 0 100
AA 100 175
AA 150 200
Now i need only one record for the above results as AA 0 200. Min of Top and Max of Bottom for each name.
Thanks
Name, Top, Bottom and some other fields. The results looks like
AA 0 100
AA 100 175
AA 150 200
Now i need only one record for the above results as AA 0 200. Min of Top and Max of Bottom for each name.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You all..I think its working.
You need to accept one of the comment to close the question
select distinct name
, (select min(YourFieldName) from YourTable where Name = A.Name)
, (select max(YourOtherFieldName) from YourTable where Name = A.Name)
from YourTable AS A