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 |
|
jgonzalez14
Yak Posting Veteran
73 Posts |
Posted - 2008-11-13 : 14:51:18
|
I am trying to make a query that will select all T.Hotel where T.Hotel does not equal P.Inncode. The query below finds where the are equal to each other but when I change the = to <> it returns where T.Hotel <> P.Inncode but it returns 30,000 records (there is only like 100 records total) Now if I code get this 'does not equal' How can I insert this in to P.Hotel?ThanksSELECT T.Hotel, P.InncodeFROM ME_Hotels AS T INNER JOIN MeetingExcellence_Hotels AS P ON T.Hotel = P.Inncode |
|
|
jgonzalez14
Yak Posting Veteran
73 Posts |
Posted - 2008-11-13 : 14:59:22
|
| Ah I figured it outSELECT Hotel AS NOTINFROM ME_Hotels AS TWHERE (Hotel NOT IN (SELECT Inncode FROM MeetingExcellence_Hotels))But now how can i make a dynamic insert statement in to MeetingExcellence_Hotels? |
 |
|
|
jgonzalez14
Yak Posting Veteran
73 Posts |
Posted - 2008-11-13 : 15:07:26
|
| and I figured the insert issue to INSERT INTO MeetingExcellence_Hotels (Inncode, Hotel)SELECT Hotel, Inncode FROM ME_Hotels AS TWHERE (Hotel NOT IN (SELECT Inncode FROM MeetingExcellence_Hotels))thanks |
 |
|
|
|
|
|