Вы сказали:
> SELECT property.ID, property.address, property.postcode, property.lease, firstName, lastName FROM property INNER JOIN landlords ON firstName LIKE '%spina%' OR lastName LIKE '%spina%'
Ваше выражение соединения должно указывать, как связаны две таблицы, например
... LEFT JOIN landlords ON landlords.ID == property.landlord_ID ...
А затем переместите ваш выбор в предложение WHERE
:
... WHERE firstName LIKE '%spina%' OR lastName LIKE '%spina%'
пример:
> cat > landlords.csv
1,Alex,Spina
2,Spina,Brown
3,Katell,Jentreau
> cat > properties.csv
1,toytown
2,hogwarts
3,mars
4,new york
2,sheffield
> sqlite3
> CREATE TABLE landlords (ID,firstname,lastname);
> .import "landlords.csv" "landlords";
> CREATE TABLE properties (landlord,address);
> .import "properties.csv" "properties";
> SELECT * FROM properties JOIN landlords ON landlord = ID
WHERE (firstname LIKE "Spina" OR lastname LIKE "Spina");
landlord,address,ID,firstname,lastname
1,toytown,1,Alex,Spina
2,hogwarts,2,Spina,Brown
2,sheffield,2,Spina,Brown