I’m finding it difficult learning how to formulate subqueries in MySQL
For example, this code doesnt seem to be working.
SHOW COLUMNS FROM $table WHERE Field NOT IN (
SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = $table
AND column_name LIKE 'project_images_%'
);
Does anyone have any suggestions? or good resources on subqueries?
Your query is fine, you just forgot the quotes.
Note the quotes added to the where clause in the sub-query.