December 12, 2009

MySQL2

(1)
SELECT SUM(UnitPrice*Quantity) AS 訂貨總價
FROM OrderDetails
WHERE OrderID IN
(SELECT OrderID
FROM Orders
WHERE EmployeeID=3 );

(2)
SELECT EmployeeID AS 員工編號
FROM Employees
WHERE DateDiff("YYYY",BirthDate,NOW()) IN
(SELECT max(DateDiff("YYYY",BirthDate,NOW()))
FROM Employees);

(3)
SELECT sum(UnitPrice*Quantity)
FROM OrderDetails
WHERE OrderID IN
(
SELECT OrderID
From Orders
WHERE EmployeeID IN
(
SELECT EmployeeID
FROM Employees
WHERE DateDiff("YYYY",BirthDate,NOW()) IN
(SELECT max(DateDiff("YYYY",BirthDate,NOW()))
FROM Employees)
)
)
;

由 b101098135 發表於 December 12, 2009 08:45 PM
迴響

http://www.chinahaitong.com/bbs/forum.php?mod=viewthread&tid=14556 阿權的部落格: MySQL2

Posted by: http://www.xnx3.com/bbs/home.php?mod=space&uid=2037&do=blog&quickforward=1&id=8379 發表於 November 14, 2013 09:50 PM

尼斯的努力,通過這個帖子做!

Posted by: http://alwaysbefitandsmart.blogspot.com 發表於 November 29, 2013 06:11 PM

尼斯的努力,通過這個帖子做!

Posted by: Kyle Leon 發表於 November 29, 2013 06:18 PM

晚上在家準備一個燭光晚餐,

Posted by: http://tolookfor.us/story.php?title=beauty-of-your-skin 發表於 November 30, 2013 03:19 PM

那真是一個不錯的文章...很不錯的東西,具有良好的思想和觀念,很多偉大的信息和靈感,這兩者我們都需要。

Posted by: http://forbookmark.com/story.php?title=vision-without-glasses 發表於 November 30, 2013 07:31 PM

那真是一個不錯的文章...很不錯的東西,具有良好的思想和觀念,很多偉大的信息和靈感,這兩者我們都需要。

Posted by: http://cutetweets.com/story.php?title=what-is-cellulite 發表於 December 2, 2013 02:41 PM

尼斯的努力,通過這個帖子做!

Posted by: http://mirocky.com/story.php?title=-grow-taller-4-idiots-review 發表於 December 2, 2013 02:57 PM
發表迴響









記住我的資訊?





請依上圖輸入檢核碼: