Compare two identical sql tables by a condition

Viewed 56

Say I have two tables that look something like this:

Table1 has columns A, B, C and D

Table2 has the same columns as Table 1

A has the exact same data for both tables. B is equals to 1 for all rows for Table1 and 2 for all rows for Table2.

Both tables have the exact same number rows. How would I create a query that outputs the corresponding value in A for rows where Table1.C > Table2.C?

2 Answers
Related