这几句sql语句是什么意思?

来源:百度知道 编辑:UC知道 时间:2024/05/27 05:32:30
select count( prodCode) from table1 where prodCount like '[1-2]%'

select count( prodCode) from table1 where prodCount between 10 and 20
//条件2
select count( prodCode),prodType from table1 group by prodType
// 条件3
select count( prodCode) from table1 where prodPrice < (select avg(prodPrice) from table1)
// 条件4
select count(distinct prodAddress) from table1

//条件1
select count(studCode),courseCode from course_ch group by courseCode
//条件2
select distinct courseCode from course_ch
//条件3
select studName,studFaculty,studBirthday from student a ,course_ch b
where a.studCode=b.studCode and b.courseCode='电子工程系'
order by studBirthday ,sex desc
//条件4
select studName from student where studName like '李%'
//条件5
select * from student a left join course_ch b on a.studCode=b.studCode
//条件6

count()统计记录
group by 分组
sum()求和
distinct 获取唯一记录,相同记录不显示
like 舆字符匹配
left join 左连接

最基础的语句,还是自己稍微翻翻书吧