Link to home
Start Free TrialLog in
Avatar of krisyash
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
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if angelIII solution doesn't work, try:
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
Avatar of krisyash
krisyash

ASKER

Thank You all..I think its working.
You need to accept one of the comment to close the question