【发布时间】:2014-10-30 19:16:39
【问题描述】:
我有一个表,我想从这个表中选择条件 type =1 , type =2, type =3 的数据,每个类型限制为 5。
如果我使用以下命令,3个表连接到彼此);所以我有 5x5x5 = 125 条记录!
SELECT *
FROM
(
( select * from `question` where type = 1 limit 5) as t1 ,
(select * from `question` where type = 2 limit 5) as t2,
(select * from `question` where type = 3 limit 5) as t3
)
如何仅使用 1 个命令选择此数据,从而获得包含 15 条记录的表?
【问题讨论】:
标签: mysql