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

select from multiple tables

2006-03-17 Thread Miguel Vaz
Hi guys, I am kinda new to mysql and on my endeavour to build a backend for a site i am building, i need to fetch data from a couple of tables, but dont know how to do it with a single select. Heres the problem: first table (products): id id_type

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

Select * from multiple tables

2003-06-25 Thread tlr7425
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 looking some books! How do get a resultset of

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
es varchar(25) YES (NULL) prod_uses pid int(11) 0 uid int(11) 0 I hope this works out for you. Marcel - Original Message - From: "Mikey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 12:54 PM Subject: SELECT from multiple tables... >

SELECT from multiple tables...

2003-05-30 Thread Mikey
Hi NG, this is my first visit here, so please be gentle!!! I have a table of products (`prods`), and a separate table of product uses (`uses`) and the products are linked to their uses by a list (`prod_uses`). What I need to be able to do is allow a search of products by their use and I am gettin

Re: Select from multiple tables

2003-02-24 Thread Tore Bostrup
WHERE D.CompanyID = 36 HTH, Tore. - Original Message - From: "Frank de Bot" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 5:33 PM Subject: Select from multiple tables > Hi, > > I got the following query: > > SELECT *

Select from multiple tables

2003-02-24 Thread Frank de Bot
Hi, I got the following query: SELECT * FROM t1,t2 In the result I get as column just the column name only, but I like to get the table name with it, just I must use it in the where clause. How can I do this? Thanks in advanced, Frank de Bot --

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

select from multiple tables

2002-10-16 Thread Veysel Harun Sahin
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 query became so complex. Because i have written "left join" between all of my tables and also if i need to query so