Thanks, Jocelyn. That's what I was looking for.
Jocelyn Fournier wrote:
Hi,
SELECT products.sku, products.title, products.price,
qty_price.qty, qty_price.qprice
FROM products LEFT JOIN qty_price ON (products.sku = qty_price.qsku)
WHERE products.vendor_id=15 AND products.category='widgets';
s
ecember 21, 2006 9:56 AM
To: mysql@lists.mysql.com
Subject: select from two tables when they correspond, otherwise one table
This query will display from the 'products' and 'qty_price' tables when
the 'products.sku' and 'qty_price.qsku' fields match:
S
Hi,
SELECT products.sku, products.title, products.price,
qty_price.qty, qty_price.qprice
FROM products LEFT JOIN qty_price ON (products.sku = qty_price.qsku)
WHERE products.vendor_id=15 AND products.category='widgets';
should do what you want.
Regards,
Jocelyn Fournier
www.mesdiscussions.
This query will display from the 'products' and 'qty_price' tables when
the 'products.sku' and 'qty_price.qsku' fields match:
SELECT products.sku, products.title, products.price,
qty_price.qty, qty_price.qprice
FROM products, qty_price WHERE products.sku = qty_price.qsku
AND products.vendor_id=1
Ted Byrne wrote:
you didn't say that (svr,started,ended,volume,who) is a unique key...
If not, it would explain the result and the extra rows you get.
Well... that combination of fields *should* be unique. Does a unique
index need to be specified on those columns? It is possible that
(svr,star
You didn't even say that (svr, started, ended, volume, who, action) was a
unique combination of values for either table. If that is the case then
you will have a hard time matching rows of one table uniquely to rows of
the other table.
Shawn,
Sorry for the lack of clarity on my part. The combina
Ted,
You didn't even say that (svr, started, ended, volume, who, action) was a
unique combination of values for either table. If that is the case then
you will have a hard time matching rows of one table uniquely to rows of
the other table.
Try this query and you may be able to see where the
you didn't say that (svr,started,ended,volume,who) is a unique key...
If not, it would explain the result and the extra rows you get.
Well... that combination of fields *should* be unique. Does a unique index
need to be specified on those columns? It is possible that
(svr,started,ended,volume,
mysql>select count(*)
from x.table_a,y.table_b
WHERE
x.table_a.svr = y.table_b.svr and
x.table_a.started = y.table_b.started and
x.table_a.ended = y.table_b.ended and
x.table_a.volume = y.table_b.volume and
x.table_a.who = y.table_b.who;
you didn't say that (svr,started,ended,volume,who) is a uniq
I'm struggling with this, and am not sure what I'm doing wrong... There
are two tables in separate databases that have 6 fields in common. In
addition to the six columns in common between table_a and table_b, each
table has some additional fields that are not related. Table_a and table_b
each
Hi!
I have got two tables: 'item' and 'propertie'.
Table 'item' has index column named 'id_propertie' which refers to one row
in table 'propertie'. Table 'propertie' has string column 'value'.
I want to get the value of colun 'value' from table 'propertie' which index
is same than in table 'item
Hi,
if you are using 4.x or later you can use:
(select * from helpdesk where month(helpdesk.hdcreatedate) = 3)
UNION ALL
(select * from archived where month(archived.hdcreatedate) = 3)
LIMIT 0, 30;
/Johan
rmck wrote:
Hi
I have two tables in the same Db :
table 1:
helpdesk | CREATE TABLE `hel
Hi
I have two tables in the same Db :
table 1:
helpdesk | CREATE TABLE `helpdesk` (
`wcalledname` varchar(50) default NULL,
`wcalledphone` varchar(50) default NULL,
`wcalledemail` varchar(50) default NULL,
`typeof` varchar(50) default NULL,
`status` varchar(25) default NULL,
`reason
Hi
I have two tables in the same Db :
table 1:
helpdesk | CREATE TABLE `helpdesk` (
`wcalledname` varchar(50) default NULL,
`wcalledphone` varchar(50) default NULL,
`wcalledemail` varchar(50) default NULL,
`typeof` varchar(50) default NULL,
`status` varchar(25) default NULL,
`reason
* zhu xiaofeng
> Sent: Thursday, October 09, 2003 4:45 AM
An old question, but no replies...
> There is a question:
> Two tables:
>table_out: ( fields ) product_name,out_count , out_date
>table_in: ( fields ) product_name,in_count , in_date
> I want to create
Hi all:
There is a question:
Two tables:
table_out: ( fields ) product_name,out_count , out_date
table_in: ( fields ) product_name,in_count , in_date
I want to create a table that show the remain of product.
Can you help me??
thanks in advance!
--
MySQL G
Dear MySQL Wizards,
I discovered a solution that works to resolve this problem. :-)
Here are the steps I took.
--
1. At the O/S, I copied the three MySQL files to a new name, a_copy.
2. I used mySQLman to delete an index and then to recreate it. I did this
because the syst
17 matches
Mail list logo