On Mon, 19 Jan 2009, Duane Hill wrote:
I have two tables defined:
CREATE TABLE `tga_body` (
`body_id` int(10) unsigned NOT NULL auto_increment,
`blob_pos` mediumint(8) unsigned NOT NULL,
`file_id` int(10) unsigned NOT NULL,
`blob_id` int(10) unsigned NOT NULL,
PRIMAR
I have two tables defined:
CREATE TABLE `tga_body` (
`body_id` int(10) unsigned NOT NULL auto_increment,
`blob_pos` mediumint(8) unsigned NOT NULL,
`file_id` int(10) unsigned NOT NULL,
`blob_id` int(10) unsigned NOT NULL,
PRIMARY KEY USING BTREE (`body_id`),
>Although correct, many people consider this bad style - the ON
clause
>of the JOIN should contain only the join condition(s). So it would
be
>better to say
Yes indeed but here the 'zip' condition is in the join for the
possibility that the constant zip condition could speed up the join.
See S
news <[EMAIL PROTECTED]> wrote on 05/11/2005 09:09:36 AM:
> In article <[EMAIL PROTECTED]>,
> Peter Brawley <[EMAIL PROTECTED]> writes:
>
> > Scott, sorry, my mistake,
> > SELECT price
> > FROM fedex_zones z
> > INNER JOIN fedex_rates r ON z.zone=r.zone AND z.zip=94947
> > WHERE r.weight
In article <[EMAIL PROTECTED]>,
Peter Brawley <[EMAIL PROTECTED]> writes:
> Scott, sorry, my mistake,
> SELECT price
> FROM fedex_zones z
> INNER JOIN fedex_rates r ON z.zone=r.zone AND z.zip=94947
> WHERE r.weight = 25;
> PB
Although correct, many people consider this bad style - the ON
Scott, sorry, my mistake,
SELECT price
FROM fedex_zones z
INNER JOIN fedex_rates r ON z.zone=r.zone AND z.zip=94947
WHERE r.weight = 25;
PB
Scott Haneda wrote:
on 5/10/05 8:29 PM, Peter Brawley at [EMAIL PROTECTED] wrote:
Scott,
...In part, my t
Hi,
>>> SELECT zone from fedex_zones where zip = 94947
>>> select price from fedex_rates where zone = '8' and weight = '25'
your query should be :
select price from fedex_rates, fedex_zones
where fedex_zones.zip = 94947
and fedex_zones.zip = fedex_rates.zip
and fedex_rates.weight = '2
on 5/10/05 8:29 PM, Peter Brawley at [EMAIL PROTECTED] wrote:
> Scott,
>
>> ...In part, my trouble is that I need to take the resuling zone from the
>> first
>> select and use that to determine the field name.
>
>> I can easily do this in my code in 2 selects, but was hoping to be able to
>> get
Scott,
>...In part, my trouble is that I need to take the resuling zone
from the first
>select and use that to determine the field name.
>I can easily do this in my code in 2 selects, but was hoping to be
able to
>get the price back in just one select, if possible...
If you have control over
Getting a little stuck on this one:
Table defs below:
I have two tables, fedex_zones contains zip code to zone data, so for
example, zip 94947 is in zone 8
select zone from fedex_zones where zip = '94947'
> 8
Now, in the defex_rates table is how, based on weight, I can look up how
much it will c
10 matches
Mail list logo