RE: What is wrong with this query?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What exactly are you trying to do? If you require data from each table and that data is linked somehow thur some common field (not required to be the same field across all three tables) you need to include that


SELECT a.*, b.*,c.* FROM MLS a, Cond b, Comm c where [join crtieria] and [search crtieria] ORDER BY Price DESC LIMIT 0, 50


need more info about structure and goal

bastien

From: "Chris Payne" <cjp@xxxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Subject:  What is wrong with this query?
Date: Sat, 22 Jan 2005 23:44:29 -0500

Hi there everyone,



I?m trying to select data from 3 tables, I?m using the following code:



SELECT * FROM MLS, Cond, Comm ORDER BY Price DESC LIMIT 0, 50



But it?s not working, I thought this is how it worked but I guess I?m wrong.
It?s just a basic query, but needs to pull all the info from all 3 tables in
the same DB, what am I doing wrong? It works perfectly if I just use 1
table.




Chris


-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.2 - Release Date: 1/21/2005


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux