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
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
[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
[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
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
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
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
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(
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
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
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
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
12 matches
Mail list logo