0
我有以下查詢,每當我運行它,它給了我不正確的語法附近「作爲」語法不正確
select
count(id_cat) as catcnt,
id_cat, ccatname, ccatpermalink,
(select ccatname
from btnn_classifiedcategory
where syncoperation <>'D' and id_ccat = id_cat) as catname
from
btnn_myclassifides
where
syncoperation <> 'D'
and Expirydate >= cast(convert(varchar(100), getdate(), 101) as datetime)
and id_cat in (select id_ccat
from BTNN_ClassifiedCategory
where syncoperation <> 'D' and id_ccat = bcc.id_ccat) as cnt
from BTNN_ClassifiedCategory bcc
據我查詢請幫我
現在給出多部分標識符「bcc.id_ccat」無法綁定,列名'ccatname'無效,列名'ccatpermalink'無效。錯誤marc – Aties 2011-12-28 09:40:37
@Aties:更新了我的回覆 - 現在能工作嗎?你的整個查詢是相當混亂的....爲了確保你選擇了正確的東西,你應該爲所涉及的所有表擁有**正確的表別名......我只是猜測在這裏,因爲我不知道你的桌子結構和你真的想做什麼... – 2011-12-28 09:42:34
沒有傢伙不工作,但thnx兄弟的幫助。 – Aties 2011-12-28 09:45:32