I have an Open Office database. I'd like to use the LIKE operator with "%" marks between two columns in the same table:
SELECT * FROM "table1" WHERE UPPER ( "table1"."a" ) LIKE UPPER ('%' + "table1"."b" + '%' )
But it doesn't work, although
SELECT * FROM "table1" WHERE UPPER ( "table1"."a" ) LIKE UPPER ("table1"."b")
works. What's wrong in my syntax?
Missing a + on the front after the % and before table.
SELECT [insert your fields here] FROM "table1" WHERE UPPER ( "table1"."a" ) LIKE UPPER ('%' + "table1"."b" + '%' )
SELECT [insert your fields here] FROM "table1" WHERE UPPER ( "table1"."a" ) LIKE '%' + UPPER("table1"."b") + '%'
I'm assuming A and B are both of the same data type.
I'm assuming + is an string concat in openoffice. other possible values are || or &