Re: Simple, free RDBMS for VB3/6 with minimal installation footprint

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Try this syntax:

SELECT
C.CompanyName,
O.OrderDate,
S.CompanyName
FROM Shippers S
INNER JOIN Orders O ON (S.ShipperID = O.ShipVia)
INNER JOIN Customers C ON (C.CustomerID = O.CustomerID)

What wrapper do you use now to connect to SQLite?

RBS


"MM" <kylix_is@xxxxxxxxxxx> wrote in message news:qd4al2la6oabgm2dsh092pt0aapgnj367k@xxxxxxxxxx
On Fri, 10 Nov 2006 21:14:55 -0000, "RB Smissaert"
<bartsmissaert@xxxxxxxxxxxxxxxx> wrote:

Joins are working fine, try this on the NWind DB:

SELECT C.CustomerID, O.ShipName from Customers C inner join Orders O on
(C.CustomerID = O.CustomerID)

Only these are not supported:
LEFT OUTER JOIN is implemented, but not RIGHT OUTER JOIN or FULL OUTER JOIN.

I also got a query with ONE inner join to work, but not two.

My first query, using the nwind.db example:

SELECT Customers.CompanyName, Orders.OrderDate FROM Customers INNER
JOIN Orders ON Customers.CustomerID = Orders.CustomerID;

returns 830 rows, just as in Access.

But when I try a query with TWO inner joins, it barfs:

SELECT Customers.CompanyName, Orders.OrderDate, Shippers.CompanyName
FROM Shippers INNER JOIN (Customers INNER JOIN Orders ON
Customers.CustomerID = Orders.CustomerID) ON Shippers.ShipperID =
Orders.ShipVia;

Sqlite/SQLiteSimpleQuery now says:

no such column: Customers.CompanyName

Unless there is a weird undocumented syntax specific to Sqlite that I
don't know about, it apparently cannot parse the two inner joins.

By the way, this is not a failing of the wrapper code. If you pump the
'two inner joins' query straight into Sqlite3.exe in a DOS window, it
also says:

no such column: Customers.CompanyName

MM

.



Relevant Pages

  • Re: Should be simple but....
    ... FROM Customers C ... INNER JOIN ORDERS O ... INNER JOIN [ORDER DETAILS] OD ...
    (microsoft.public.sqlserver.programming)
  • Re: Sql Northwind DB
    ... Provide a SQL statement and sample result set that will ... list all Customers within the CA state. ... count the total orders for all Customers within the CA ... (Products INNER JOIN ((Employees INNER JOIN ...
    (microsoft.public.sqlserver.mseq)
  • Re: Whats wrong with this UPDATE stmt?
    ... > The FROM clause used here creates a cross product. ... > INNER JOIN. ... > Customers table. ...
    (microsoft.public.access.queries)
  • Re: How to left
    ... With your original tables and fields - I would use a query like the following. ... FROM Customers LEFT JOIN Orders ... FROM (ChangeRecords INNER JOIN IssueRecords ON ChangeRecords.ChangeRecord=IssueRecords.ParentRecord) INNER JOIN Assignments ON ChangeRecords.ChangeRecord=Assignments.RecordNumber ... the customer will appear even if there are no complaints or orders. ...
    (microsoft.public.access.queries)
  • RE: How can I count the number of individuals?
    ... where Customers is the name of the table. ... To count those who match certain criteria add a WHERE clause, ... FROM Customers INNER JOIN Cities; ... Four tables are involved here Customers, Orders, Order Details and Products. ...
    (microsoft.public.access.queries)