两张表
表1 A:
id int
status int
default_name nvarchar表2 B:
id int
lang nvarchar
name nvarchar求一条高效的sql语句,其结果等于
(select id from A where id not in (select A.id from A, B where A.id=B.id and A.status=1 and lang='en') and status=1) union (select A.id from A, B where A.id =B.id and A.status=1 and lang='en')
表1 A:
id int
status int
default_name nvarchar表2 B:
id int
lang nvarchar
name nvarchar求一条高效的sql语句,其结果等于
(select id from A where id not in (select A.id from A, B where A.id=B.id and A.status=1 and lang='en') and status=1) union (select A.id from A, B where A.id =B.id and A.status=1 and lang='en')
解决方案 »
- 请教一个查询语句,上火啊 !感谢大家帮忙!
- 请问如何用oracle触发器实现不允许新增/删除表/增加/减少/修改字段类型
- 如何在oracle中定义和执行字符串
- 表空间问题
- 怎样写SQL语句使学习起始时间的年份与学习结束时间的年份相同?
- 数据库的数据存储在哪?硬盘?内存?还是?
- 请问各位储存过程是多写好还是把数据处理放到中间层处理的好?
- (新手问题)关于游标和数据集~的问题~~
- 公司要做个内部订餐系统,我刚把SQL写好,小妹对SQL不是很熟,高手进来指点一下
- oracle缺省地用户名字和口令都有什么?
- 急急急急急!!求一条sql语句????
- 关于sqlplus dbms_output.putline(var)参数
- --
1 aa
2 bb
3 ccSQL> select * from ab;I LANG NAME
- ------ ----
1 aa 123
2 en 456
3 en 789SQL> select a.id,case when b.lang='en' then b.name else a.status end
2 from aa a,ab b
3 where a.id=b.id;I CASE
- ----
1 aa
2 456
3 789