select col1,col2,col3 from table1 where col1 = 'a'
多表查询的话可能要看你想要实现的结果,有内联接,外联接等写法
如 select a.col1,a.col2,b.col1,b.col2 from a join b where a.col3 = b.col3
select 用户,count(任务) as '任务总数',count(case 状态='进行' then 状态 end ) as '进行的数量',
count(case 状态='延期' then 状态 end ) as '延期的数量',
count(case 状态='取消' then 状态 end ) as '取消的数量',
count(case 状态='完成' then 状态 end ) as '完成的数量'
from 表格名 group by 用户
你好
数据库的表查询语句使用的是select语句
格式如下:
select 字段 from 表名 过滤条件;
过滤条件字句:
where 字段=’过滤’;
其中,字句可以写的非常复杂,包括子查询,嵌套子查询等等
学习好一个查询至少要三五天时间
祝你好运
望采纳
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)