I am trying to do an inner join with row number using dapper MSSQL and I keep getting this exception Additional information: The column 'id' was specified multiple times for 'threadem . I have 2 tables threads and zips and they both have a primary key of id I don't know if that has to do with it, this is my code
SELECT z.*,
t.*
FROM (SELECT ROW_NUMBER() OVER (ORDER BY t.activities DESC) AS Row,
z.*,
t.*
FROM threads t
INNER JOIN zips z
ON z.city = @Ucity
AND z.state = @Ustate
WHERE t.latitudes >= z.ThirtyLatMin
AND z.ThirtyLatMax >= t.latitudes
AND t.longitudes >= z.ThirtyLonMin
AND z.ThirtyLonMax >= t.longitudes) AS threadem
WHERE ROW >= 1
AND Row <= 5
what can I fix above to stop getting this error