sql where 多个条件进行查询导出,请高手指点!!

2024-11-05 17:26:17
推荐回答(3个)
回答1:

你没有指定别名,有歧义了,改成下面的:
SELECT id,title,softlinks FROM dede_addonsoft d1,dede_archives d2 WHERE d1.aid=d2.id and d2.arcrank=0 and d2.typeid=13 into outfile 'e:\1.txt'

回答2:

SELECT b.id,b.title,a.softlinks FROM dede_addonsoft a,dede_archives b WHERE a.aid=b.id and b.arcrank=0 and b.typeid=13 and a.typeid=13 into outfile 'e:\1.txt'

回答3:

select id,title,(select softlinks from dede_addonsoft where aid=a.id and typeid=a.typeid) as softlinks
from dede_archives a where typeid=13 and arcrank=0