1. 程式人生 > >mysql 子查詢

mysql 子查詢

mysq sql classname sna name from use lec mysql

1.標量子查詢

select *from myuser where classid=
(
select classid from myclass
where classname=‘2班‘
)

2.列子查詢

select *from myuser where classid in
(
select classid from myclass
)

3.行子查詢


SELECT * from myuser
where (classid,age)=
(
select max(classid),min(age)
from myuser
)

mysql 子查詢