save me from an unconstrained join

Поиск
Список
Период
Сортировка
От Robert Treat
Тема save me from an unconstrained join
Дата
Msg-id 1112216088.28936.404.camel@camel
обсуждение исходный текст
Ответы Re: save me from an unconstrained join  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
It actually does what I want... but it offends my database
sensibilities... :-)


Heres the basics of the tables involved:

CREATE TABLE bds_filesize (   bds_filesize_id serial   name text NOT NULL,   byte_limit integer NOT NULL,   slots
integerNOT NULL
 
);


CREATE TABLE software (   software_binary_id serial,   binary_file oid,   filename text,   filesize integer,   checksum
text
);


query:

select software_binary_id, min(byte_limit) 
from bds_filesize, software_binary 
where byte_limit > filesize GROUP BY software_binary_id;


Basically each software is assigned a "class" based on the size of its
binary into a predetermined range of classes that are defined as
relative filesizes. The above query really does work... but istm I ought
to be joining those tables somehow... any ideas? 


Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Joel Fradkin"
Дата:
Сообщение: delphi access question?
Следующее
От: "Gregory S. Williamson"
Дата:
Сообщение: Re: delphi access question?