SunQuest
           MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old January 13th, 2000, 07:58 PM
elin elin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Posts: 20 elin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am trying to do a query that requires an inner join of 4 tables then left join to a 5th table.

Here is my query:

SELECT s.Time, s.Amount, u.LastName, u.FirstName, u.HAddress_1,
u.HCity, u.HState, u.HZip, i.SKU, a.Owner, p.Value AS Local_Assn
FROM (SalesOrders s, Users u, SalesItems i, Accounts a) LEFT JOIN Preferences p ON (u.User = p.User)
WHERE s.SalesOrder = i.SalesOrder
AND s.Account = a.Account
AND a.Owner = u.User
AND p.Attr = 'assoc1'
AND s.Status = 'completed'
AND i.SKU LIKE 'car%'
ORDER BY s.Time

Quite a mouthful. The query runs, but gives an inner join on all 5 tables. Where am I going wrong with my syntax?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Complex Left Join


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway