I have this query :
SELECT Company_Name FROM tblBeneficaries WHERE BeneficaryID IN ()
When I execute it it returns the message:
Incorrect syntax near ‘)’.
What is the problem?
Advertisement
Answer
That’s because, your IN
clause has no parameter/argument WHERE BeneficaryID IN ()
. It should be WHERE BeneficaryID IN (id1,id2,id3, ...,idn)
Your current query is same as saying below, no need of the WHERE
condition
SELECT Company_Name FROM tblBeneficaries