On 7/9/06, Andrew Scott <[EMAIL PROTECTED]> wrote: > OK, > > When looking at this it doesn't make sense to me. If I run this in SQL 2000, > it converts the query to this > > > SELECT Bookings.BO_ID, BookingItems.BI_ID > INTO BookingOptions > FROM Bookings CROSS JOIN > BookingItems > > And the BO_ID is always the same when it shouldn't be. >
A cross join returns the cartesian product of the two tables, which I don't think is what you are going for...specify the relationship explicitly.... SELECT Bookings.BO_ID, BookingItems.BI_ID INTO BookingOptions FROM Bookings INNER JOIN BookingItems ON Bookings.BO_ID = BookingItems.BO_ID -- Jim Wright Wright Business Solutions [EMAIL PROTECTED] 919-417-2257 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/cf_lists/message.cfm/forumid:6/messageid:2501 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
