[SQL ] 資料查詢問題
(針對 SQL 語言的問題,用這個標題。請用 Ctrl+Y 砍掉這行)
資料庫名稱:MYSQL
資料庫版本:MySQL 伺服器版
內容/問題描述:
http://ppt.cc/ITNl
select name.age from personnel
where salary>45000 and department =
(select department from personnel where
salary > 40000 group by department
having count(department);
關於我的,語法請益
我下這樣的查詢語法,總是會爆錯,不知道哪裡不符合文法的邏輯呢?
資料庫一直撈不到以建立好的資料。
謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.39.0.180
※ 文章網址: https://www.ptt.cc/bbs/Database/M.1422002356.A.82C.html
→
01/23 17:14, , 1F
01/23 17:14, 1F
不知道大大可以指導一下嗎^^"
※ 編輯: oklp1415 (118.171.38.31), 01/23/2015 22:42:25
→
01/24 08:36, , 2F
01/24 08:36, 2F
→
01/24 08:37, , 3F
01/24 08:37, 3F
→
01/24 08:38, , 4F
01/24 08:38, 4F
→
01/24 08:38, , 5F
01/24 08:38, 5F
→
01/24 08:38, , 6F
01/24 08:38, 6F
這樣還是有爆錯的情況
You have an error in your SQL syntax; check the manual that for the right syntax to use near '' at line 5: select name.age from
personnel where salary>45000 and department = (select department from
personnel where salary > 40000 group by department having count(department)
※ 編輯: oklp1415 (118.171.40.176), 01/24/2015 23:29:57
→
01/29 10:31, , 7F
01/29 10:31, 7F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):