[SQL] Temp tables and functions

2006-10-10 Thread mark.dingee
Everyone, I've written a function (language = sql) which uses a temporary table to simplify the process; however, when I go to load the function I get: /var/lib/pgsql$cat thm.sql | psql test ERROR: relation "lost_bus" does not exist where "lost_bus" is the name of my temp table. The function

Re: [SQL] Am I crazy or is this SQL not possible

2006-06-01 Thread mark.dingee
Collin, I have a similar circumstance in one of my own apps. I operate under the simple presumption that the unique_id is sequential and thus the record with the highest unique_id is the most recent entry. In that case I use a query such as select * from broadcast_history where unique_id in (

[SQL] Question on UNION

2006-05-22 Thread mark.dingee
Everyone, I ran into something I wasn't expecting while developing a new application. I have two similar tables that are occasionally unioned pulling only about 3 fields from each. During my testing phase I noticed that the union statement was returning what appeared to be a distinct list rat