Hello forums!!

How to query in following case:
Suppose we have two tables
Code:
--------------
table1
--------------
id
title
field
--------------


--------------
table2
--------------
id
title
table1_id (FK to table1)
field (Same field as in table1)
--------------
Question
How to Select all the rows from table2 based on the following:
If table1's 'field' has some value i.e. > 0 then
relate with table2's 'field'
else
relate table1's id & table2's table1_id, and additionally filter by table1.table1_id = some value.

How to perform such in single query?

Thanks in advance for the help.