http://sqlfiddle.com/#!2/41cf8/1
I actually expect it to return something like this
firstname - chuck
lastname - null
But it returning me only firstname rows
how i can modify it to return lastname with null value as well ?
Thank You
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll want to move the
AND users_meta.meta_user_id = 1from the WHERE clause into the JOIN clause.In the WHERE clause, it limits the returned rows. In JOIN, it limits only the JOINed rows, and since you are using LEFT join, you’ll still get last name.