dkfr.net
当前位置:首页 >> mysql 和并列 >>

mysql 和并列

SELECT GROUP_CONCAT(name SEPARATOR ' ') AS name FROM A

select concat(doctror_id,',',doctor_name) from t_c_doctor

select a.id,a.name,b.money from table1 a left join table2 b on a.id=b.idunion select b.id,a.name,b.money from table1 a right join table2 b on a.id=b.id 或select tab.id,table1.name,table2.money from (SELECT id FROM `table1`union...

select * from message where (typeid=31) or (typeid=30) or (typeid=32) or (typeid=33) order by id desc; 或者 select * from message where typeid IN ( 31, 30, 32, 33) order by id desc;

select * from (select Student.S#,Sname,Sage,Ssex,SC.C#,score,Cname from SC inner join Student on SC.S#=Student.S# inner join Course on Course.C#=SC.C#) as t where exists( select count(1) from t as d where C#=d.C# and score < d....

ORDER BY 成绩 DESC,时间 DESC

where后加多个条件可以用and来连接。 如,student表中有如下数据: 现在要查,sex为男,age为20的那些数据,可用如下语句: select * from student where ...

select t1.name,t2.name,t3.name from table1 t1,table2 t2,table3,t3 where t1.id=t2.id and t1.id=t3.id limit 1,3 就是这个样子了,mysql的分页最好写了

首先 判断 变量 是否存在,然后动态生成 sql 查询条件。 php 类似代码如下:

select * from table where a='xxx' and b='xxx'

网站首页 | 网站地图
All rights reserved Powered by www.dkfr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com