Re: [SQL] sql

2007-02-06 Thread Penchalaiah P.
Hi... I tried this its working.. can u please check this. select count(*) as all, sum(decode(entry_user_id,'VC',1)) as entry_user_id,sum(decode(entry_user_id,'VE',1)) as VE ,sum(decode(entry_user_id,CV,1))as CV,sum(decode(entry_user_id,'SC',1))as SC from vigilance_master; regards penchal

Re: [SQL] Index ANDing Index ORing

2007-02-06 Thread Richard Huxton
Hiltibidal, Robert wrote: Does postgres have support for index ANDing and index ORing? Well, 8.1+ will create an on-the-fly bitmap for x=1 AND y=2 type of queries. What were you thinking for ORing? -- Richard Huxton Archonet Ltd ---(end of

Re: [SQL] Compilation errors

2007-02-06 Thread Richard Huxton
Hiltibidal, Robert wrote: Is this a good group to post compilation errors to? Probably better with pgsql-general -- Richard Huxton Archonet Ltd ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] PL/pgsql declaration of string / bit / number with given (variable!) length

2007-02-06 Thread Richard Huxton
sneumann wrote: Hi, I have a PL/pgsql function that creates a certain bit string based on the parameters. Things work fine if I use bit(10) throughout the function. Now I'd like to return a bit string with the given size len, but that breaks with a syntax error: ret :=

Re: [SQL] Index ANDing Index ORing

2007-02-06 Thread Richard Huxton
Hiltibidal, Robert wrote: Morning I currently use DB2 on an AIX 5.2 p5 platform 7gb ram for log analytics with heavy OLAP querying. Index ANDing in DB2 allows for multiple indexes to be used in joins. I'm not sure of the ORing function yet. That's what 8.1+ support. The bitmap is in-memory

Re: [SQL] Compilation Error AIX

2007-02-06 Thread Alvaro Herrera
Hiltibidal, Robert wrote: I am getting this error I thought you were supposed to post in pgsql-general ... make -C port all make[3]: Entering directory `/db2/logs/downloads/postgres/postgresql-8.2.1/src/backend/port' gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline

Re: [SQL] Index ANDing Index ORing

2007-02-06 Thread Richard Huxton
Hiltibidal, Robert wrote: Keep in mind that 2/3 of the inserts are actual log entries. 1/3 are for supporting information like ip, query string values etc. The table is a star table. You are correct tho in terms of time.. When I did the same application with fpc pascal

[SQL] Removing duplicate rows

2007-02-06 Thread Paul Lambert
I have some tables which I need to load from flat data files that can contain upwards of five million rows. It's possible (owing to the structure of the system the data is originating from) that on occasion the data extract that generates these flat files can include two records that have the

Re: [SQL] Removing duplicate rows

2007-02-06 Thread Andrew Sullivan
On Wed, Feb 07, 2007 at 07:15:02AM +0900, Paul Lambert wrote: I'm assuming the best way to get around this is to load the data into a temporary table with copy from and then do a select distinct into my real table. You might find that sort|uniq at the command prompt would be better. That

Re: [SQL] Removing duplicate rows

2007-02-06 Thread Paul Lambert
Andrew Sullivan wrote: On Wed, Feb 07, 2007 at 07:15:02AM +0900, Paul Lambert wrote: I'm assuming the best way to get around this is to load the data into a temporary table with copy from and then do a select distinct into my real table. You might find that sort|uniq at the command prompt

Re: [SQL] Removing duplicate rows

2007-02-06 Thread Hélder M . Vieira
As the table definitions get updated frequently, I'd like to put in my script to create the table as a copy of the existing 'real' table. I'm assuming create table as would be what I need to use, but what would I use as the select sql - i.e. how do I use select to pull the definition of a

Re: [SQL] Removing duplicate rows

2007-02-06 Thread Thomas Kellerer
Paul Lambert wrote on 06.02.2007 23:44: Sort on Weenblows is a bastard to work with, and I don't believe it has a unique option. I probably should have mentioned this was on Weenblows. You can get all (or most?) of the *nix/GNU commandline tools for Windows as well. As native Win32