Board logo

標題: [疑難] 想問一0的SQL Statement點寫,唔該幫0下手 [打印本頁]

作者: saihang    時間: 2007-4-22 11:12     標題: 想問一0的SQL Statement點寫,唔該幫0下手

呢個database要入呢三個table

想做以下查詢
list晒唔同area之中邊個bal最大同最細個數目
list晒有邊個employee無order跟
customer names 同employee names要list成咁,for example landi wong變成Landi WONG,即係cfname或者efname要同clname或者elname combine埋一齊
比埋其他code你地睇
http://hk.geocities.com/jfksaihang/lab4.txt
作者: testme    時間: 2007-5-6 09:50

questions are not clear.
data table definitions are not clear. (eg. id = no?)
作者: joecat    時間: 2007-5-22 13:12

TRY TRY!!

list晒唔同area之中邊個bal最大同最細個數目
SELECT area FROM customerfour WHERE MAX(bal), MIN(bal) GROUPBY area;

list晒有邊個employee無order跟
SELECT * FROM employeefour, orderfour WHERE empid is null;

[ 本帖最後由 joecat 於 2007-5-22 13:25 編輯 ]
作者: gicky555    時間: 2007-5-23 00:20

提示: 作者被禁止或刪除 內容自動屏蔽
作者: joecat    時間: 2007-5-24 16:36

之前post的不太正確, 請試試下以下SQL!!!

list晒唔同area之中邊個bal最大同最細個數目
複製內容到剪貼板
代碼:
list晒有邊個employee無order跟, efname轉第一個字母大寫和elname全部字母大寫
複製內容到剪貼板
代碼:
SELECT StrConv([efname],3) & " " & StrConv([elname],1) AS [Employee Name]
FROM employeefour LEFT JOIN orderfour ON empno = empid
WHERE (((empid) Is Null))
GROUP BY StrConv([efname],3) & " " & StrConv([elname],1);
以上SQL試過可在ACCESS運行的!!

[ 本帖最後由 joecat 於 2007-5-24 16:42 編輯 ]




歡迎光臨 香港 Xocat Forum 討論區 (http://p.xocat.com/p/) Powered by Discuz! 6.0.0