I’m trying to compare two tables using some sql I found. The error message I’m receiving is:
The select statement includes a reserved word or an argument name that is Misspelled or missing, or the punctuation is incorrect
The code I used is at the bottom.
Please let me know if you need more information or if you’re able to determine the problem from just look at the code.
Thanks for your help
[sql]SELECT MIN(Project_Compare) as Table1, App_Num,
From
(
SELECT 'Table A' as Project_Watch_list_9_14_11_tbl, App_Num
From A
UNION ALL
SELECT 'Table B' as Project_Watch_list_9_15_11_tbl, App_Num
FROM B
) tmp
Group By app_num
Having Count (*) = 1
Order By App_Num[/sql]
[SQL]SELECT MIN(TableName) as TableName, ID, COL1, COL2, COL3 ...
FROM
(
SELECT 'Table A' as TableName, A.ID, A.COL1, A.COL2, A.COL3, ...
FROM A
UNION ALL
SELECT 'Table B' as TableName, B.ID, B.COL1, B.COl2, B.COL3, ...
FROM B
) tmp
GROUP BY ID, COL1, COL2, COL3 ...
HAVING COUNT(*) = 1
ORDER BY ID[/sql]
The select statement includes a reserved word or an argument name that is Misspelled or missing, or the punctuation is incorrect
The code I used is at the bottom.
Please let me know if you need more information or if you’re able to determine the problem from just look at the code.
Thanks for your help
[sql]SELECT MIN(Project_Compare) as Table1, App_Num,
From
(
SELECT 'Table A' as Project_Watch_list_9_14_11_tbl, App_Num
From A
UNION ALL
SELECT 'Table B' as Project_Watch_list_9_15_11_tbl, App_Num
FROM B
) tmp
Group By app_num
Having Count (*) = 1
Order By App_Num[/sql]
[SQL]SELECT MIN(TableName) as TableName, ID, COL1, COL2, COL3 ...
FROM
(
SELECT 'Table A' as TableName, A.ID, A.COL1, A.COL2, A.COL3, ...
FROM A
UNION ALL
SELECT 'Table B' as TableName, B.ID, B.COL1, B.COl2, B.COL3, ...
FROM B
) tmp
GROUP BY ID, COL1, COL2, COL3 ...
HAVING COUNT(*) = 1
ORDER BY ID[/sql]