Postgres Question

Lance F. Squire lance-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Wed Jun 29 16:07:55 UTC 2005


I need to search on the $ value of something in a table where multiple 
currencies are allowed, and the currency conversion rates are in another 
table.

For instance, on EBay, things can be listed in US, CDN or GBP etc...

Assuming the table has these fields:

Value | Currency
-----------------
10.00 | US
25.00 | CDN
30.00 | GBP

and the conversion table had these fields:

Currency | Conversion
----------------------
US       | 1
CDN      | .75
GBP      | .55

(Yes, values ARE guessed at here. ;) )

What would be the sainest way to search for anything less than $x CDN?

Would implimenting a View, or any other DB feature make this more efficient?

I've only done simple and joined quieries so far. How to attack this 
escapes me so far...

Lance F. Squire
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list