如何编写不大于MySQL查询中的值?
查询中的“不大于”可以简单地写为小于或等于(<=)。语法如下-
select * from yourTableName where yourColumnName<=yourColumnName;
让我们首先创建一个表-
create table DemoTable1480 -> ( -> StudentName varchar(40), -> StudentMarks int -> );
使用插入命令在表中插入一些记录-
insert into DemoTable1480 values('Chris',78);
insert into DemoTable1480 values('Bob',45);
insert into DemoTable1480 values('John',67);
insert into DemoTable1480 values('Adam',56);使用select语句显示表中的所有记录-
select * from DemoTable1480;
这将产生以下输出-
+-------------+--------------+ | StudentName | StudentMarks | +-------------+--------------+ | Chris | 78 | | Bob | 45 | | John | 67 | | Adam | 56 | +-------------+--------------+ 4 rows in set (0.00 sec)
以下是要写入的查询不大于MySQL查询中的查询-
select * from DemoTable1480 where StudentMarks <=65;
这将产生以下输出-
+-------------+--------------+ | StudentName | StudentMarks | +-------------+--------------+ | Bob | 45 | | Adam | 56 | +-------------+--------------+ 2 rows in set (0.00 sec)
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短