Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7072183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:46:40+00:00 2026-05-28T05:46:40+00:00

Evening, im not sure on what im asking here but I will try to

  • 0

Evening, im not sure on what im asking here but I will try to explain. I’m not the best at SQL but I do try…

SELECT 
    qu.job_id, qu.engineer_id, qu.id AS `quote_id`, 
    jb.author, jb.image_ref, jb.job_title 
FROM 
    `ecom_quotes` qu, `ecom_jobs` jb 
WHERE 
    jb.author = 1 
AND 
    qu.job_id = jb.image_ref
GROUP BY 
    jb.image_ref

I used the above to list jobs posted by a user and getting other information from other tables based on the job id.

The problem being that if a job has no quotes posted for it, it does not display (qu.job_id = jb.image_ref).

So as a quick fix ( or so I thought ) i replaced it with

( ( qu.job_id = jb.image_ref ) OR ( jb.image_ref != '' ) )

which did work but it returns a quote id when there is no quote associated with it.

Is there anything i can do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:46:40+00:00Added an answer on May 28, 2026 at 5:46 am

    You’ll want to use a LEFT JOIN.

    This will still return a record for ecom_jobs even when there is no matching record in ecom_quotes.

    EDIT: Switched the order of the tables…

    SELECT 
        qu.job_id, qu.engineer_id, qu.id AS `quote_id`, 
        jb.author, jb.image_ref, jb.job_title 
    FROM 
        `ecom_jobs` jb
        LEFT JOIN `ecom_quotes` qu ON qu.job_id = jb.image_ref
    WHERE 
        jb.author = 1
    GROUP BY 
        jb.image_re
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think that I am having a slow evening but I have a question
This will be my last question for the evening and a while. I have
Evening, Trying to follow the Django tutorial, as seen here, https://docs.djangoproject.com/en/dev/intro/tutorial01/ I run the
I'm implementing an SOA at a large company, and I'm not sure which web
Good evening, I'm having trouble with model binding and validation but I don't know
Evening All, Had a question on whether or not the use of Absolute postioning
Not sure if this is an appropriate forum to ask as this isn't really
I've been trying to figure this out all evening but to no avail. I
good evening, i need to check if the input match my regex or not
Evening all - Whats the best way to access an image's height and width

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.