I am trying to create a union select query, but getting a message saying:All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.Can you please tell me, what mistake am i doing.Select 0 as ProgID, '* Select *' as ProgNO,null as AccessMode union SELECT A.ProgID, B.ProgNO, B.ProgName, A.AccessMode FROM TAB_Programs AS A JOIN TAB_Programs AS B ON A.ProgID = B.ProgID WHERE A.UserID = @UserID AND A.AccessMode = 2 AND A.Deleted = '0'
Thank you very much for the helpful info.