I have a following query with subquery that returns no result
SELECT 'Message'
FROM message
WHERE ID in (
SELECT 'Message_id'
FROM user_message
WHERE 'status' =false )
Data in both tables is present. What could be the problem?
Why are you using a sub-query?
Why not
SELECT Message
FROM message JOIN user_message ON ID = Message_id
WHERE status = false
Seems simpler
You quoted the fields. Either do not quote the fields, or escape your fields with tick like this
SELECT `Message`
FROM message
WHERE ID in (
SELECT `Message_id`
FROM user_message
WHERE `status` =false )
user_message.
select message from message where id in ( select message_id from user_message where status = false ). No single quotes but can have back ticks on column names.