I have a table:
TableA
-----------
id | propertyA | propertyB
How can insert new row into table if row with propertyA and propertyB don't exist yet? PropertyA and propertyB are not unique so I can't use replace.
I have a table:
TableA
-----------
id | propertyA | propertyB
How can insert new row into table if row with propertyA and propertyB don't exist yet? PropertyA and propertyB are not unique so I can't use replace.
You proberly can use somthing like:
INSERT INTO TableA(propertyA, propertyB)
SELECT :a, :b
FROM DUAL
LEFT JOIN TableA ON (propertyA = :a AND propertyB = :b)
WHERE TableA.id IS NULL;