34,575
社区成员
发帖
与我相关
我的任务
分享
create table tb(
id int identity(1,1) primary key,
uid int --用户ID
sale_name varchar(50)
sale_info text
uFlag tinyint)--0为个人,1为企业
/*************************************/
select a.id,a.sale_name,a.sale_info
from tb a,? b
where a.uid=b.id
select a.id,a.sale_name,a.sale_info
from tb a,(select id,xTb=case when uFlag=0 then 'userReg' else 'compReg' end from tb) b
where a.uid=b.id
select a.id,a.sale_name,a.sale_info
from tb a,(select id, xTb=case when uFlag=0 then 'userReg' else 'compReg' end from tb) b
where a.uid=b.id
--B表这里少了一个ID
select a.id,a.sale_name,a.sale_info
from tb a,(select xTb=case when uFlag=0 then 'userReg' else 'compReg' end from tb) b
where a.uid=b.id
可查询分析器报错