多表查询 乱乱的 记录下

select TagID from TagTreeView where ParentID=503
<!--CRLF-->
 
<!--CRLF-->
select * from Tags
<!--CRLF-->
left outer join MultiLangCategories on MultiLangCategories.CategoryID=Tags.TagID
<!--CRLF-->
where SystemID=1 and IsSharing=1 and Deleted=0 
<!--CRLF-->
    and TagID in(select TagID from TagTreeView where ParentID=503)
<!--CRLF-->
 
<!--CRLF-->
select * from Tags as ata
<!--CRLF-->
full join MultiLangCategories as amu on amu.CategoryID=ata.TagID
<!--CRLF-->
full join BuyInfo as abu on abu.BuyInfoSort = amu.CategoryID
<!--CRLF-->
where SystemID=1 and IsSharing=1 and ata.Deleted=0 
<!--CRLF-->
    and TagID in(select TagID from TagTreeView where ParentID=503)
<!--CRLF-->
    and abu.autono =3
<!--CRLF-->
 
<!--CRLF-->
select value from Tags as ata full join MultiLangCategories as amu on amu.CategoryID=ata.TagID full join BuyInfo as abu on abu.BuyInfoSort = amu.CategoryID where SystemID=1 and IsSharing=1 and ata.Deleted=0 and TagID in(select TagID from TagTreeView where ParentID=503) and abu.autono =3
<!--CRLF-->
 
<!--CRLF-->
select TagID from TagTreeView where ParentID=503
<!--CRLF-->
 
<!--CRLF-->
select * from Buyinfo
<!--CRLF-->
select * from Multilangcategories
<!--CRLF-->
select * from Tags
<!--CRLF-->

你可能感兴趣的:(查询)