MySQL joined select

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Mar 17 06:56:24 EDT 2012


Hi,

First, you need to create one big table. You do this with

SELECT * FROM table1,table2

This table will be way too big, so you need to add a way to select only the relevant rows from that very big table, e.g.

SELECT * FROM table1,table2 WHERE table1.key = table2.key

You need to test and change it until you really get only rows that make sense. Now you can add a condition and determine which columns to select:

SELECT A,B,C,D FROM table1,table2 WHERE table1.key = table2.key AND table2.C < table1.B

and that completes the query.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Download the Installer Maker Plugin 1.7 for LiveCode here http://qery.us/za

On 17 mrt 2012, at 11:44, Marek Reichenbach wrote:

> I'm trying to do in LiveCode with MySQL:
> how to use data from other table in the same query for filtering:
> 
> SELECT A, B ,C, (SELECT D FROM TABLE2 WHERE C[from table2] < B[from
> table1]) FROM TABLE1; <-- the stucture of query
> 
> help please :/
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list