Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cognos
Starting Member
10 Posts |
Posted - 2011-06-01 : 07:50:22
|
| Select odate, amt, snum, cnumfrom orderswhere amt = (select max(amt) from orders)this will show max amt.i want to show cname also.it is another table cust.how can i write query.ddd |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2011-06-01 : 07:52:31
|
| join the customers table ona comman column present in both the tables. |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-06-01 : 07:56:27
|
| SELECT c.cName, o.odate, o.amt, o.snum, o.cnumFROMcust cINNER JOIN( Select <link to cust>,odate, amt, snum, cnum from orders where amt = (select max(amt) from orders)) oON c.<link to cust> = o.linkingfieldJimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|