Jump to content

MYSQL Query Help


garethhall

Recommended Posts

Hello,

 

I have a SQL query below and it works but I have a slight problem.

When fl.body_value is empty I don't get a result. So how do I Join on a table even if it's empty? In this case f.uri will always have a value.

 

 

SELECT 
f.uri ,
fl.body_value 
FROM node n 
RIGHT JOIN field_data_com_slider_image fd 
ON n.nid = fd.entity_id 
RIGHT JOIN file_managed f 
ON fd.com_slider_image_fid = f.fid 
RIGHT OUTER JOIN field_data_body fl 
ON n.nid = fl.entity_id
WHERE n.type = 'com_slider' 
AND n.status = 1

 

Link to comment
https://forums.phpfreaks.com/topic/229183-mysql-query-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.