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 6892141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:29:50+00:00 2026-05-27T06:29:50+00:00

I have the following query, which I designed to compile data from a number

  • 0

I have the following query, which I designed to compile data from a number of views based on client data.

SELECT 
  vw_clients.client_id, 
  name, 
  exts, 
  vms, 
  ivrs, 
  queues, 
  conf10, 
  conf20, 
  conf30
FROM 
  vw_clients, 
  vw_exts, 
  vw_vms, 
  vw_ivrs, 
  vw_queues, 
  vw_conf10, 
  vw_conf20, 
  vw_conf30
WHERE 
  vw_clients.client_id = vw_exts.client_id AND 
  vw_clients.client_id = vw_vms.client_id AND 
  vw_clients.client_id = vw_ivrs.client_id AND 
  vw_clients.client_id = vw_queues.client_id AND
  vw_clients.client_id = vw_conf10.client_id AND
  vw_clients.client_id = vw_conf20.client_id AND
  vw_clients.client_id = vw_conf30.client_id;

The query works fine so long as there are records in every view relating to the records in vw_clients. However I need to modify this to use a left join, so that it returns all records from vm_clients and only those from the other views that have records for those clients.

I’ve read about left joins, but at most I have only found info on joining one or maybe two tables – but I need to join 8. Do I do a left join on vw_clients.client_id to the corresponding client_id field in all of the views? What’s the syntax for that?

Would be grateful for any help. I’m very close to solving this issue and I think this is the last piece of the puzzle!

Many thanks.

  • 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-27T06:29:51+00:00Added an answer on May 27, 2026 at 6:29 am

    You can use left join by putting vw_clients in the first in the from list, then all other tables followed after left join. The left join can join only two tables or one “result set” and a table,where the result set is the result of the former join.

    In your case:

    SELECT 
        T0.client_id, name, exts, vms, ivrs, queues, conf10, conf20, conf30
    FROM 
        vw_clients T0
        left join  vw_exts T1 on T0.client_Id=T1.client_id
        Left join  vw_vms T2 on ...
        ...
    Where ...
    

    Maybe here you don’t need where clause.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query which have 1000 rows select staffdiscountstartdate,datediff(day,groupstartdate,staffdiscountstartdate), EmployeeID from tblEmployees
I have the following which works in SQL Query Analyzer . select oh.* from
I have the following Query which produces the output below; SELECT TBLUSERS.USERID, TBLUSERS.ADusername, TBLACCESSLEVELS.ACCESSLEVELID,
I have the following raw query which moves items from a shopping cart to
I have the following query which obtains transactions from the transactions table and transaction
I have the following query which is inside a loop and is breaking SELECT
I have the following query.. SELECT Flights.flightno, Flights.timestamp, Flights.route FROM Flights WHERE Flights.adshex =
I have following query which groups and counts entries for each day : SELECT
I have the following query: $query = $this->getEntityManager()->createQuery(' SELECT u, p, m FROM MyCoreBundle:User
I have the following query which works fine with MySQL but refuses to work

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.