2012-04-16 117 views

回答

2

事情是這樣的:

excludedCustomers = π(Customer_ID)(tbl_Bill) 
customerReservations= π(Customer_ID)(tbl_Reservation) 
result = customerReservations- excludedCustomers 

你只需要得到你想要排除(全部來自tbl_Bill)客戶的投影,做tbl_Reservation相同,從兩個預測減法是你的答案。

+0

感謝您的回答。你知道如何編寫這個查詢嗎? – Smith 2012-04-17 01:09:44

+0

select top 1 drinkcode from tbl_order group by drinkcode order by count(*)desc – Smith 2012-04-17 01:09:50

+0

其實我對此有疑問。你有什麼好的鏈接去研究代數表達式嗎?我一直在閱讀一些網站,但我可以找到的最好的網站是[鏈接](http://www.go4expert.com/forums/showthread.php?t=21166),它並沒有幫助我編寫前1名選擇,按數量排序(*)desc。我完全不是來自開發領域,所以請告訴我,如果你有任何良好的學習鏈接。 – Smith 2012-04-17 05:39:49