Hello,I found this forum while searching in Google about SQL.I'm new to database programming and I don't know how to solve my problem and even how to define my question, that's why I made an example. Let's have a database with 2 tables:+---------------------+| table1 |+---+--------+--------+|aid|counter1|counter2|+---+--------+--------+| 1 | 5 | 2 |+---+--------+--------+| 2 | 7 | 3 |+---+--------+--------+| 3 | 8 | 4 |+---+--------+--------+| 4 | 10 | 8 |+---+--------+--------+| 5 | 12 | 11 |+---+--------+--------+| 6 | 18 | 15 |+---+--------+--------+
and+---------------------+| table2 |+---+--------+--------+|bid|counter1|counter2|+---+--------+--------+| 1 | 2 | 1 |+---+--------+--------+| 2 | 7 | 2 |+---+--------+--------+| 3 | 8 | 5 |+---+--------+--------+| 4 | 11 | 7 |+---+--------+--------+| 5 | 13 | 10 |+---+--------+--------+| 6 | 18 | 12 |+---+--------+--------+
I need a query that returns the following result when counter1 = 7 and counter2 sorted in ascending order:+---+---+--------+|aid|bid|counter2|+---+---+--------+|nul| 2 | 2 |+---+---+--------+|2 |nul| 3 |+---+---+--------+
Is it possible such query to be made?