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 |
|
sqlchiq
Posting Yak Master
133 Posts |
Posted - 2008-08-25 : 11:32:35
|
| I have a table A and a table BI want to display everything in table A and also display everything in table Bbut, if 4 columns match, i want that row to display only the row in Table B, and if that row is a duplicate, I want it to display the one that's min(thatcolumn)Does that make sense?i triedselect *from morganscleaner t full outer join (select hotel, roomtype, checkindate, roomrate, executiontime from morganscleaner group by hotel, roomtype, checkindate, roomrate, executiontime) ron t.hotel=r.hotel, t.roomtype = r.roomtype, t.checkindate = r.checkindate, t.executiontime = r.executiontimeorder by hotel, roomtype, executiontime, checkindatebut its giving me a syntax error by the = error, I dont even think the above is correct anyway |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-25 : 11:39:06
|
Otherwise replace your commas with ANDon t.hotel = r.hotel AND t.roomtype = r.roomtype AND t.checkindate = r.checkindate AND t.executiontime = r.executiontimeorder by hotel, roomtype, executiontime, checkindate E 12°55'05.25"N 56°04'39.16" |
 |
|
|
sqlchiq
Posting Yak Master
133 Posts |
|
|
|
|
|
|
|