I am facing a problem while using Select statement where I have a column name as 'Value', and I want to retrieve the values based on the 'value' column with SELECT
and LIKE
operators.
Code:
SELECT compo.clecompo
FROM compo compo
ON (compo.clecompo = metadatas_compo.clecompo)
AND ((metadatas_compo.value LIKE '%%NOM%%')
OR (metadatas_values.metavalues_name LIKE '%%NOM%%'))
I highlighted the value keyword.. It's a sample of my query where i am not getting any results.
Note: (metadatas_compo.value)
metadatas_compo
is table name.
You escape literals in MySQL using backticks `
However, it is advised to not use reserved literals in your table/column names. For a list of reserved words:
http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html