I have a query
Select id, contact_name from Profile where TRIM(IFNULL(contact_name,'')) <> ''
and I am trying to pass it into a Bash script.
mysql --user abc -psomePass MyData -e "SELECT `id`,`contact_name` from `Profile` where TRIM(IFNULL(`contact_name`,'') <> ''" | while read term_id; do
done
but it doesn't like the singe quotes ''
. How do I format this in the script?
I have tried
TRIM(IFNULL(`contact_name`,\'\') <> \'\'"
and
TRIM(IFNULL(`contact_name`,\") <> \""
and
TRIM(IFNULL(`contact_name`,"''") <> "''""
I am out of ideas.