Written some cool source code? Upload it to Programmer's Heaven.

VB.NET

Moderators: seancampbell
Number of threads: 3653
Number of posts: 9344

This Forum Only
Post New Thread

Report
MYSQL INNER JOIN Posted by azdonald on 25 Nov 2009 at 7:24 AM
Please can i have multiple innner join statements in mysql??
tried to combine two but got a syntax error.
this is a sample of what i did

SELECT invoice.transid. invoice.airline, invoice.agent, airline.name, agent.name from invoice INNER JOIN airline, agent
WHERE invoice.airline=airline.name and invoice.agent=agent.name
Report
Re: MYSQL INNER JOIN Posted by seancampbell on 1 Dec 2009 at 8:47 AM
Just double checked the syntax here by looking at an example here: http://www.plus2net.com/sql_tutorial/sql_inner_join.php

You had a period after Invoice.transid instead of a comma
SELECT invoice.transid, invoice.airline, invoice.agent, airline.name, agent.name FROM invoice INNER JOIN airline ON invoice.airline = airline.name INNER JOIN agent ON invoice.agent = agent.name



SELECT Fields FROM Table1 INNER JOIN Table2 ON Table1.Value = Table2.Value WHERE (Conditions pertaining to any table's values)

I removed the WHERE clause because it pertained to what you wanted your Inner Joins to do



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A BootstrapLabs project.