标签:studentNO -- 查询 --- distinct studentResult result select
查询
-- 别名,给结果起个别名 as 可以给字段起别名,也可以给表起别名
select `studentNO` as学号,`studentName` as学生姓名 from stdent as s;
-- 函数concat(a,b)
select concat(`姓名`,studentName) as 新名字 from student;
select version() -- 查询系统版本(函数)
select 100*3-1 as 计算结果 -- 用来计算(表达式)
select @@auto_increment_increment -- 查询自增的步长(变量)
select distinct `studentNO` from result -- 数据重复,去重
select `studentNO`,`studentResult`+1 as'提分后' from result -- 学员考试成绩+1分查看
-- 查询成绩在95-100之间
select studentNO,studentResult from result where studentResult>=95 and studentResult<=100;
select studentNO,studentResult from result where studentResult between 95 and 100; --模糊查询
逻辑运算符
运算符 | 语法 | 描述 |
---|---|---|
and && | a and b a&&B | 逻辑与,2个都为真,结果才为真 |
or || | a or b a||b | 逻辑或,其中一个为真,就为真 |
not ! | not a !a | 逻辑非,真为假,假为真 |
标签:studentNO,--,查询,---,distinct,studentResult,result,select 来源: https://www.cnblogs.com/123xian/p/16098975.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。