DQL 查询表中的数据:查询语句(最复杂的语句)不会对数据库中的数据进行修改,只是一种显示数据的方式 语法格式: select 字段列表 from 表名列表 where 条件列表 group by 分组字段 having 分组之后的条件 order by 排序 limit 分页限定 一.基础查询 1.查询表所有行和列的数据,使用*表示所有列 select * from 表名; 2.查询指定列 select 字段名1,字段名2,字段名3,... from 表名; 3.指定列的别名进行查询 使用别名…
1.distinct select count(distinct CName) from teble select count(CName) from (select distinct CName from Course) as temp SELECT DISTINCT text_zhcn FROM dms_menuconfig -- 去重查询表中数据 select DISTINCT(user_id) from user_info where children_merchant_id='kuai…
Oralce 表中存有一个字段,该字段存储表名,要把该表中的所有表名查询出来(即表名结果集),且执行结果集from 表名结果集: declare v_ccount ); --定义一个游标变量 cursor c_job is --查询该表中的所有表名 select tablename from tbname; c_row c_job%rowtype; begin --循环待处理数据,即以上查出的结果集 for c_row in c_job loop ---执行语句 from 循环的表名 并插入 e…