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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.