SQL—查询的基本用法—查

xiaoxiao2025-03-13  12

SQL—查询的基本用法—查

select这个是查询和其他语法的起点 1、查询表中的全部内容:

语法:select * from 表名

查找所有列表.png

2、条件查找

语法:select 列名 from 表名 where 查询条件表达试

条件查找.png

3、查询排序

语法:select 列名>from 表名 order by 排序的列名[asc或desc]

order by.png

4、模糊查询

语法:select * from where 表名 like 条件(a%)

like用法.png

5、查询表中不重复的数据

语法:select distinct * from 表名

注:distinct 关键词用于返回唯一不同的值。

distinct用法.png

6、between用法

语法:select * from表名 where 列名 between 范围1 and 范围2

between用法.png

7、in 用法

语法:select * from表名 where 名 in (具体值,具体值)

in 用法.png

转载请注明原文地址: https://www.6miu.com/read-5025764.html

最新回复(0)