![](/img/trans.png)
[英]Selecting the last record of yesterday and all records of today in single query
[英]Selecting a Group of records based on a single Record Value
這應該工作:
select * from table where group_id in
(
select group_id from table where type = 1
)
您也可以嘗試join
,而不是in
select a.* from table a
join
(
select group_id from table where type = 1
) b on b.group_id = a.group_id
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.