1、 表结构和测试数据插入
建表:
-- Create table
create table TAB_FXHS
(
id VARCHAR2(32),
zt VARCHAR2(2)
);
-- Add comments to the table
comment on table TAB_FXHS
is '用于统计状态值全为正常的id值';
-- Add comments to the columns
comment on column TAB_FXHS.id
is '主键ID';
comment on column TAB_FXHS.zt
is '状态';
插入测试数据:
prompt Importing table TAB_FXHS...
set feedback off
set define off
insert into TAB_FXHS (ID, ZT)values ('10125', '0');
insert into TAB_FXHS (ID, ZT)values ('10161', '0');
insert into TAB_FXHS (ID, ZT)values ('10141', '0');
insert into TAB_FXHS (ID, ZT)values ('10126', '1');
insert into TAB_FXHS (ID, ZT)values ('10102', '0');
insert into TAB_FXHS (ID, ZT)values ('10103', '0');
insert into TAB_FXHS (ID, ZT)values ('10121', '0'

本文通过分析函数解决SQL查询问题,详细介绍了如何在表TAB_FXHS中,针对ID字段,找出所有状态ZT全部为1的记录。首先展示了表结构和测试数据插入,接着说明了功能需求,最后给出了实现该功能的SQL语句。
&spm=1001.2101.3001.5002&articleId=6712853&d=1&t=3&u=03c581a87dcc4b5aa185a741d19c8699)
2156

被折叠的 条评论
为什么被折叠?



