Re: select from multiple tables

2006-03-18 Thread Peter Brawley
Miguel > What i need is to list all the products and show the type name of each of them. What you need is a join (http://dev.mysql.com/doc/refman/5.0/en/join.html), eg: SELECT t.id, t.id_type, t.name, t.desc, t.price, p.name FROM tbl AS t INNER JOIN products AS p USING (id) PB - Mi

Re: Select * from multiple tables

2003-06-26 Thread Paul DuBois
At 2:58 -0400 6/26/03, [EMAIL PROTECTED] wrote: Ok, I trying to get this example... what is "table1 t1, table2 t2, table3 t3, table4 t4", I mean, what does the t1, t2, t3, t4 represent? If you say, table 1, table 2, etc well, I assume that, but isn't that there already? t1, t2, etc. are tab

Re: Select * from multiple tables

2003-06-26 Thread gerald_clark
[EMAIL PROTECTED] wrote: Ok, I trying to get this example... what is "table1 t1, table2 t2, table3 t3, table4 t4", I mean, what does the t1, t2, t3, t4 represent? If you say, table 1, table 2, etc well, I assume that, but isn't that there already? Let me, or may I, give ask again with m

Re: Select * from multiple tables

2003-06-26 Thread Peter Rønning
[EMAIL PROTECTED]: > Ok, I trying to get this example... what is "table1 t1, table2 t2, > table3 t3, table4 t4", I mean, what does the t1, t2, t3, t4 represent? > If you say, table 1, table 2, etc well, I assume that, but isn't > that there already? t1, t2 etc represents an alias for the t

Re: Select * from multiple tables

2003-06-26 Thread tlr7425
Ok, I trying to get this example... what is "table1 t1, table2 t2, table3 t3, table4 t4", I mean, what does the t1, t2, t3, t4 represent? If you say, table 1, table 2, etc well, I assume that, but isn't that there already? Let me, or may I, give ask again with my visual? Here are my table

Re: Select * from multiple tables

2003-06-25 Thread Paul DuBois
At 1:23 -0400 6/26/03, [EMAIL PROTECTED] wrote: I grown my db to 4 tables 8). I'm going to ask this plainly in hopes that my "syntax" in ok: I know how to SELECT * from 2 related tables and get all the records listed in the resultset. (Either using INNER JOIN or WHERE.) Now... and I have been

Re: SELECT from multiple tables...

2003-05-30 Thread Marcel Forget
D]>; <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 8:17 PM Subject: Re: SELECT from multiple tables... > Hi, > > It would work something like this: > SELECT * FROM products p, uses u, prod_uses pu WHERE p.pid=pu.pid AND > u.uid=pu.uid AND productname='produc

Re: SELECT from multiple tables...

2003-05-30 Thread Marcel Forget
Hi, It would work something like this: SELECT * FROM products p, uses u, prod_uses pu WHERE p.pid=pu.pid AND u.uid=pu.uid AND productname='product 1'; Where products pid int(11) PRI (NULL) auto_increment productname varchar(25) YES (NULL) uses uid int(11) PRI (NULL) auto_increment uses varchar(

Re: Select from multiple tables

2003-02-24 Thread Tore Bostrup
First, you need to perform a JOIN on the two tables, otherwise you will get all combinations of rows from the two tables. But that is not what you are asking about. Using SELECT * is considered a bad programming practice. Always specify the select list (the columns you want to see/need to work o

Re: select from multiple tables - solved

2002-10-16 Thread Veysel Harun Sahin
Thanks Joseph and Kelly. I think "merge tables" will be a good solution for me. Veysel Harun Sahin wrote: > Hello, > > I have a problem with select statetement. I need to query and select > records from multiple tables which have the same column types. I have > done this with left join but my

Re: select from multiple tables

2002-10-16 Thread Kelly Firkins
Assuming that you're joining data based on colB, you would use: select t1.colA,t2.colA,t3.colA from tblA t1 inner join tblB t2 on t1.colB = t2.colB inner join tblC t3 on t1.colB = t2.colB where... You can alias the table names, but there's really no way to get around specifying the table identif

Re: select from multiple tables

2002-10-16 Thread Joseph Bueno
Hello, You can define a "merge table" and run your select on it. Check the manual for details: http://www.mysql.com/doc/en/MERGE.html Regards Joseph Bueno Veysel Harun Sahin wrote: > Hello, > > I have a problem with select statetement. I need to query and select > records from multiple tables