I have a question about finding identical rows from one table to another. I have a table for users to ask for information. So with that the query will be ran against another table. Both tables are identical except for the ID columns.
The ID columns are not involved in the query except for the
SELECT TOP 1 * FROM searchTable ORDER BY searchid DESC part.
My query looks like this
SELECT TOP 1 * FROM searchTable ORDER BY searchid DESC(SELECT A.column1, A.column2,.............. FROM dbo.searchTable A WHERE EXISTS (SELECT * FROM realTable B WHERE A.Column1 = B.Column1 AND A.Column2 = B.Column2, ....... AND A.lastColumn = B.lastColumn)) What I get when running the query is the last entered query from the query table, which is correct, but I get all the rows listed from the realTable as if everything after WHERE EXISTS is pointless. What I need is the single row query from the queryTable to list all the rows that are identical to it from the realTable. Not all the rows the realTable has.