-- Create table
create table STUDENT
(
id NUMBER,
name VARCHAR2(100),
age NUMBER,
sex INTEGER
)
tablespace DEMO
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
---1.
select * from STUDENT t where 1=1 and (t.id=1 or t.id=2 or t.id=3) and t.age=27
多个or等于in 一个范围
---2.
select t.id,t.name,
(select bb.id from banji bb where bb.id=9999 and rownum<2 ) as hh
from STUDENT t
join banji bj
on bj.id=t.id
如果字段查不出来就为null,不会影响其他值。
时间: 2024-12-10 18:50:05