In SQL is it possible to get only the rows of a table where the column name is like image
? I've tried:
SELECT * FROM `projects` WHERE COLUMN LIKE '%image%' AND `id` = '125384332'
In SQL is it possible to get only the rows of a table where the column name is like image
? I've tried:
SELECT * FROM `projects` WHERE COLUMN LIKE '%image%' AND `id` = '125384332'
Can't add this as a comment due to not enough rep, but perhaps you can do something similar to what Fred -ii- was alluding to by getting the column names from the information schema columns table, then executed a prepared statement (which I think is roughly the MySQL equivalent of dynamic SQL, but I'm not certain) to create a query that will get you a query result with only those image columns selected.
Perhaps see also Selecting columns whose name matches a regular expression in PostgreSQL and How To have Dynamic SQL in MySQL Stored Procedure.