[SQL] SQL dealing with subquery

2008-01-15 Thread Bryan Emrys
Hi all, I'm having a conceptual problem with a subquery here - any help would be appreciated. I have a table treaty_rates with columns payor, payee, rate where payor and payee are countries. Sample set: 'US','UK',5 'US','Ireland',5 'US','Netherlands',5 'US','China',10 'Canada','US',0 'Canada','Ire

[SQL] SQL dealing with subquery comparison

2008-01-15 Thread Bryan Emrys
Hi all, I'm having a conceptual problem with a subquery here - any help would be appreciated. I have a table treaty_rates with columns payor, payee, rate where payor and payee are countries. Sample set: 'US','UK',5 'US','Ireland',5 'US','Netherlands',5 'US','China',10 'Canada','US',0 'Canada','Ire

Re: [SQL] SQL dealing with subquery

2008-01-16 Thread Bryan Emrys
payee) but it looks like I'll have find some time to think about that later (I've also got to think about what to do in tie situations.). Again, thanks. Bryan On Tuesday 15 January 2008 12:40:13 pm Rodrigo E. De León Plicet wrote: > On Jan 15, 2008 1:04 PM, Bryan Emrys <

Re: [SQL] SQL dealing with subquery

2008-01-16 Thread Bryan Emrys
Following up my treaty rate thoughts, if I'm trying to get the lowest treaty payee (and rate) from a specific list of payees for every possible payor country, the following seems to work, but is it right? I'm specifically wondering about the group by clauses. (Or if there is a better way.) [table t

[SQL] Data Comparison Single Table Question

2008-04-16 Thread Bryan Emrys
I can handle this outside sql, but it seems like I should be able to do this in sql as well. 1 table: countries. 3 columns: id, name, price What I'm trying to get is a result of the price differences between every country. So if the data looks like (ignoring the id field) Taiwain 30 UK 50 U

[SQL] Conceptual Design Question

2008-06-10 Thread Bryan Emrys
Hello Everyone, In a text-heavy database, I'm trying to make an initial design decision in the following context. There is a lot of long text that I could break down into three different categories: a. Laws i. Only 1 country per law, many laws ii. Ther

[SQL] Apologies to the list. Please ignore accidental thread intrusion

2008-06-10 Thread Bryan Emrys
Sorry about that. Bryan -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

[SQL] One Text Table or Multiple Text Tables - Design Tradeoffs?

2008-06-10 Thread Bryan Emrys
(Trying to start a new thread instead of my accidental intrusion into another thread) Hello Everyone, In a text-heavy database, I'm trying to make an initial design decision in the following context. There is a lot of long text that I could break down into three different categories: