Re: [SQL] Replacing a simple nested query?

2003-07-13 Thread Joe Conway
Steve Wampler wrote: I've got a simple nested query: select * from attributes where id in (select id from attributes where (name='obsid') and (value='oid00066')); that performs abysmally. I've heard this described as the 'classic WHERE IN' problem. I may be missing something, but why can't

[SQL] Replacing a simple nested query?

2003-07-13 Thread Steve Wampler
I've got a simple nested query: select * from attributes where id in (select id from attributes where (name='obsid') and (value='oid00066')); that performs abysmally. I've heard this described as the 'classic WHERE IN' problem. Is there a better way to obtain the same results? The inne

Re: [SQL] trigger proceedures in sql

2003-07-13 Thread Jan Wieck
Rajesh Kumar Mallah wrote: Yes of course! contrib/dbmirror does execute a procedure written in 'C' called recordchange() ON update , insert , delete. If you need help in getting its source lemme know. regds Mallah. On Thursday 10 Jul 2003 11:10 am, adivi wrote: hi, can trigger proceedures (

Re: [SQL] help yourself by helping others

2003-07-13 Thread Rajesh Kumar Mallah
dear ali, something like select machine,date_part('day' , date) , sum(withdrawals) from Table where date_part('month' , date)='month in question' group by machine,date_part('day' , date) ; will give you agrregated withdrawals by machine and day, use the frontend language for formatting it. no