This is a Cartesian product, not a join.
You may have intended to join on vendor_number,
but they are not the same number of digits.

James E Hicks III wrote:

Is this query legal?

select distinct purchase_orders.header.vendor_number as number,
vendor_master.address.sequence_name as name from purchase_orders.header,
vendor_master.address where purchase_orders.header.branch = 10


With these DB's

# Database : `purchase_orders`
# --------------------------------------------------------
CREATE TABLE header (
branch mediumint(5) unsigned NOT NULL default '0',
vendor_number mediumint(7) unsigned NOT NULL default '0'
) TYPE=MyISAM;
# --------------------------------------------------------

# Database : `vendor_master`
# --------------------------------------------------------
CREATE TABLE address (
vendor_number mediumint(6) unsigned NOT NULL default '0',
sequence_name varchar(30) NOT NULL default ''
) TYPE=MyISAM;
# --------------------------------------------------------



query query query query query query query sql sql sql sql sql sql sql sql
James




---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to