II在SQL兩個表選擇項目編號
1.inventtable(itemnumber)
2.etext(itemnumber,Rkey,Rval,Lang,id,text)
我想從inventtable其中THW itemnumber相同ETEXT表和ETEXT表itemnumber包含RKEY = 1,RVAL選擇Itemnumber = 1,id = 2)。如何實現這個?
II在SQL兩個表選擇項目編號
1.inventtable(itemnumber)
2.etext(itemnumber,Rkey,Rval,Lang,id,text)
我想從inventtable其中THW itemnumber相同ETEXT表和ETEXT表itemnumber包含RKEY = 1,RVAL選擇Itemnumber = 1,id = 2)。如何實現這個?
試試這個:
select i.itemnumber
from inventtable i
join etext e on i.itemnumber = e.itemnumber
where e.Rkey = 1 and e.rval =1 and e.id =2
select i.itemnumber
from inventtable i inner join etext e
on i.itemnumber = e.itemnumber
where e.Rkey = 1
and e.rval =1
and e.id =2
Select itemnumber From inventtable
Where inventtable in (Select itemnumber From etext Where Rkey=1 AND rval=1 AND id=2)
謝謝...其工作 – 2013-04-08 09:43:01