[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How use left outer join with 3 tables in ACCESS?

Posted on 2000-05-10
13
Medium Priority
?
263 Views
Last Modified: 2010-04-04
I have 3 tables. One with customers. One with products and one which define categories of products. One product needn't a category. Now i will show with a select statement for all customers, to have all the products they have payed with the products categories or not.
I tried with left outer join and i could only put two tables(products,categories9 together. i couldn't get the customers information:

the code is like this~=:

SELECT c.name Cust, p.name, ca.name
FROM Products p LEFT OUTER JOIN Categories ca ON p.idc_R=ca.idc,
Products p LEFT OUTER JOIN Customers c ON p.idcust_R=c.idcust;

The error i get is JOIN are not supported. What i do wrong? Help me quickly, please!
0
Comment
Question by:bluecomet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
13 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2797493
Rewrite it like this:

SELECT
   c.name as Cust,
   p.name,
   ca.name
FROM
   Products p
   LEFT OUTER JOIN Categories ca
      ON (p.idc_R=ca.idc)
   LEFT OUTER JOIN Customers c
      ON (p.idcust_R=c.idcust)



Yours,

Alex
0
 
LVL 2

Author Comment

by:bluecomet
ID: 2797570
Adjusted points from 200 to 225
0
 
LVL 2

Author Comment

by:bluecomet
ID: 2797571
Sorry, but that doesn't function.

it say that the join expression is not supported.

Please, need me!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Author Comment

by:bluecomet
ID: 2797579
hehehehe...

funny, no!

sorry,

i wanted write
please, need help and not please, need me!
0
 
LVL 15

Expert Comment

by:simonet
ID: 2797828
What database are you using?

Alex
0
 
LVL 2

Expert Comment

by:hhamster
ID: 2797836
But where's the payed information? That should be 4 tables together puted in the SELECT with JOINs. Or is it that I just don't understand enough English.

But for your example it should look like this one:

SELECT
  c.name Customer,
  ca.name Category
  p.name Product,
  FROM Products p
    LEFT OUTER JOIN Categories ca
      LEFT OUTER JOIN Customers c ON (here should be an ca, not p).idcust_R=c.idcust
    ON p.idc_R=ca.idc
....

For exact help we need exact inforamtion. Write the table structures for the Primary Keys and Foreign Keys.
0
 
LVL 3

Accepted Solution

by:
shenqw earned 675 total points
ID: 2798165
if you use MsAccess,then use follow sql:

SELECT c.name AS cust, p.name, ca.name
FROM Customers c  
     LEFT OUTER JOIN
     (
       Products p
       LEFT OUTER JOIN
       Categories ca
         ON (p.idc=ca.idc)
     )
       ON (p.idcust=c.idcust)



if use dbase or paradox,then user follow sql:

SELECT c.name AS cust, p.name, ca.name
FROM customer C
  LEFT OUTER JOIN Products p
    ON (p.idcust=c.idcust)
  LEFT OUTER JOIN Categories ca
    ON (p.idc=ca.idc)


if use Oracle,then user follow sql:

SELECT c.name AS cust, p.name, ca.name
FROM customer C,Products p,Categories ca
WHERE c.idcust=p.idcust(+)
  AND p.idc=ca.idc(+)
0
 
LVL 3

Expert Comment

by:shenqw
ID: 2798223
yor must change "p.idcust" into "p.idcust_R" in my answer!  :)

Good Luck!

shenqw
0
 
LVL 15

Expert Comment

by:simonet
ID: 2798503
shenqw, isn't not good ettiquete to answer a question like that if other experts are already working with you. You should post your comment and let the user decide. If you had been the first one in this thread, that would have been ok, but that's not the case, is it?

Watchout for that kinda behaviour, since it's not very appreciated 'round here by the other experts.

Alex
0
 
LVL 3

Expert Comment

by:shenqw
ID: 2799784
hi,simonet:
  Thx for your reminder.

  But i want say, I had write the anwer 5 hours before i post it(because Something is wrong with My ISP),Also i had tried all sql in my answer in MsAccess,DBase,Paradox, I know which is right and which is wrong in MsAccess, Because all above comments were wrong in MsAccess. So  I chose the Answer mode not Comment Mode.
0
 
LVL 15

Expert Comment

by:simonet
ID: 2971315
>Because all above comments were wrong in MsAccess

The asker never stated he's using MS Access, so you couldn't assume that and post an answer.

0
 
LVL 3

Expert Comment

by:shenqw
ID: 2990025
:)))

The title of The asker's question is "How use left outer join with 3 tables in ACCESS?"

shenqw
0
 
LVL 15

Expert Comment

by:simonet
ID: 2991157
OK... my bad!
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question