where条件表达式 --统计函数 Select count(1) from student; --like模糊查询 --统计班上姓张的人数 select count(*) from student where realName like '张%'; --统计班上张姓两个字的人数 select count(*) from student where realName like '张_'; --统计班上杭州籍的学生人数 select count(*) from student where home…
9)DQL查询语句使用 SELECT语句在PL/SQL中使用,必须 采用下面用法: select id INTO 变量 from t001 where id=5; 将记录字段值取出,然后给变量赋值. 提示:select适用于有且只有一行记录 返回的情况.如果是多行查询需要使用 游标技术访问. declare v_name varchar2(10); v_sal number(7,2); begin select ename,sal into v_n…
转自:http://bbs.csdn.net/topics/370033478 对于Oracle中分页排序查询语句执行效率的比较分析 作者:lzgame 在工作中我们经常遇到需要在Oracle中进行分页.排序.查询的组合SQL语句,举例来说,通常我们会这样写:(假定表test中id是主键,并且id从1开始没有间断顺序排列) 1. SELECT * FROM ( SELECT id,a1,a2,a3,a4,a5,a6,a7,a8,a9, ROWNUM AS rn FROM test …
一道sql面试题(查询语句) id name age 1 a 11 2 b 11 3 c 12 4 d 13 5 e 12 . . . 查询age唯一的那一个 这个应该怎么写 满意答案 热心问友 2010-10-14 select * from table1 where id not in (select age from table1 group by age having count(1)>1) --Up…
ylbtech-SQL Server-Basic:SQL Server-数据库查询语句基本查询 SQL Server 数据库查询语句基本查询. 1,数据库查询语句基本查询 数据库 SQL Server Oracle 基本语句 select select * from titles select title_id,title,price,pub_id from titles select * from title where title_id=9834 select * from ti…