作者testPtt (測試)
看板Database
標題[SQL ] Select已經Select好的值
時間Tue Mar 15 08:46:09 2016
我想
Select x
from a
where xxxxx
得到單一值 'xx'
之後想
Select o,'xx'as x
from b
where ooooo
我要怎麼合併這2個查詢?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.40.164.215
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Database/M.1458002772.A.C0D.html
1F:→ moyasi: 講真的 我根本看不懂你在說什麼 03/15 10:29
2F:→ a926: SELECT 已經SELECT好的值 不就是子查詢嗎 XDDDDD 03/15 11:11
3F:→ retsamsu: Select o, (Select x from a where xxxxx) as x from b 03/15 15:14
4F:→ retsamsu: where ooooo 03/15 15:15
5F:→ testPtt: 喔 以解 寫在from裡當做一個表格 03/15 18:33
6F:→ anchime: sub query 03/18 08:40
7F:推 jonce007: 謝謝retsamsu大,我有類似問題,看到你的回答,解決了^^ 04/15 14:31