[SQL] How to store a linked list in a RDBMS

2001-06-12 Thread Srikanth Rao
I have a linked list representing a tree. How do I store it in the database? Does PGSQL give us any special procedures to deal with such structures? __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://pers

[SQL] Restricting the number of decimal digits

2001-05-16 Thread Srikanth Rao
I have a query that calculates the average of difference between timestamps. I want the output to be upto 1 decimal point. How do I do it? __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ --

[SQL] Counting rows in a table

2001-05-14 Thread Srikanth Rao
MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I have a query as follows: SELECT date(c.timestart) as ondate, c.userid, u.username, count(c.callinfoid) as numCalls, sum(b.broquant) as numBroc, sum(b.broquant)/count(c.callinfoid) as BrochuresaCall

[SQL] Memory exhaustion

2001-04-04 Thread Srikanth Rao
marketingbyoffice is a view. I start the postmaster, then issue the following query in psql console. It goes to sleep forever:-) Why? The log is as follows: --log - 010404.13:49:14.612 [1352] StartTransactionCommand 010404.13:49:14.612 [1352] query: SELECT * INTO TEMP TABLE marketi

[SQL] PIVOT of data

2001-03-14 Thread Srikanth Rao
Hi, I have a table like this: location| numbrochures | marketing ---+--+--- 101 Asheville, NC |4 | NEWS 101 Asheville, NC |1 | TV 101 Asheville, NC |3 | RADIO 101 Asheville, NC |