作者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/cn.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