文章目录
where子句用于从表中或临时数据集中查找满足指定条件的记录,可用于select、update和delete语句中的条件。
一、生成测试数据
用以下SQL创建超女基本信息表(T_GIRL),插入一些测试数据。
create table T_GIRL
(
id char(4) not null, -- 编号
name varchar2(10) not null, -- 姓名
yz varchar2(10) null, -- 颜值
sc varchar2(10) null, -- 身材
weight number(4,1) not null, -- 体重
height number(3) not null, -- 身高
birthday date not null, -- 出生时间
memo varchar2(1000) null -- 备注
);
insert into T_GIRL(id,name,yz,birthday,sc,weight,height,memo)
values('0101','西施','漂亮',to_date('2000-01-01 01:12:35','yyyy-mm-dd hh24:mi:ss'),
'火辣',48.5,170,'这是一个非常漂亮姑娘,老公是夫差,男朋友是范蠡。');
insert into T_GIRL(id,