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…