请教一句SQL语句 select *,case when exists (select 1 from 表2 where ww=表1.aa) then '已登记' else '未登记' end as DDfrom 表1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 or:select a.*,case when b.ww is null then '未登记' else '已登记' end as DDfrom 表1 a left join (select diatinct ww from 表2) as bon a.aa=b.ww oracle下的写法:select aa,bb,cc,nvl( ( select '已登记' from t2 b where a.aa = b.ww) ,'未登记') as ddfrom t1 a select 表1.AA,表1.BB,表1.CC,case when 表2.TT is null then '未登记' else '登记' end as DDfrom 表1 left join 表2 ON 表1.AA=表2.AA select 表1.* ,case when ww is not null then '已登记' else '未登记' end DDfrom 表1left join 表2on 表1.AA = 表2.WW UP jmcy12(小兔子)比较好读 大家帮我看看这个sql问题 请大家帮解决一下SQL SERVER 这道题目 高分求修改一个sql语句,要考虑执行效率 在vc程序中如何及时知道SQL数据库的更新? 求类似智能搭配的数据搭配筛选方法 请教如何对一个日期型字段原先默认值为getdate()改为默认可以为空? 那里有sqlserver7.0企业版下载???急急急!!!!!! 用not exists 为什么得不到我的结果。 一个很奇怪的问题 phpmyadmin导出导出数据库出现问题 继续刚才的问题~笨猫之后续(一) 错在哪里啊~~
from 表1 a left join (
select diatinct ww from 表2
) as b
on a.aa=b.ww
nvl( ( select '已登记' from t2 b where a.aa = b.ww) ,'未登记') as dd
from t1 a
from 表1 left join
表2 ON 表1.AA=表2.AA
case when ww is not null then '已登记' else '未登记' end DD
from 表1
left join 表2
on 表1.AA = 表2.WW
比较好读