Reputation:
i am doing left join between 2 tables in firebird sql 2.5, and i need to search them as strings with like statement.
it is like :
Table: USER :
ID | NAME | TIME | ADDRESS_FK
.
Table : ADDRESS:
ID | STREET | CITY | COUNTRY
I would like after joining theese 2 tables, to perform search for a matching string on each of the result fields.
Upvotes: 2
Views: 122
Reputation: 2277
SELECT *
FROM "USER"
LEFT JOIN ADDRESS ON ("USER".ADDRESS_FK = ADDRESS.ID)
WHERE ADDRESS.COUNTRY LIKE 'TURKEY'
SELECT *
FROM "USER"
LEFT JOIN ADDRESS ON ("USER".ADDRESS_FK = ADDRESS.ID)
WHERE ADDRESS.COUNTRY LIKE 'TURKEY' AND ADDRESS.CITY LIKE 'ISTANBUL'
Upvotes: 1