Hi all,
I am rusty in doing T-SQL and I am new in doing Database Engine Query.
I have 2 dbo Table in SSMS 2012 and in the Database Engine Query, I executed the following T-SQL code in my SSMS 2012:
SELECT Pt_ID, X, Y, Sample_id, Boring FROM dbo.Table_1_APG_XYcoord WHERE sample_id<6 UNION SELECT Boring, sample_id, Unit, Arsenic, Chromium, Lead FROM dbo.Table_2_APG_Soil WHERE sample_id>0 ORDER BY sample_id
I got the following:
MSG 205, Level 16, State 1, Line 1
All queries combined using a UINON, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.
I have no ideas what the MSG means and how to correct the problem. Please kindly help, advise and respond.
Thanks in advance,
Scott Chang