Re: [SQL] sql

2007-02-05 Thread Karthikeyan Sundaram
try this: select entry_user_id, sum(decode(entry_user_id,'VC',1,0) as vc, sum(decode(entry_user_id,'VE',1,0) as ve, sum(decode(entry_user_id,'CV',1,0) as cv, sum(decode(entry_user_id,'SC',1,0) as SC from vigilance_master group where entry_user_id=78 group by en

Re: [SQL] Search a range of cases/records

2007-02-05 Thread A. Kretschmer
am Thu, dem 01.02.2007, um 12:56:28 -0800 mailte Wei ZOU folgendes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Greetings: > > I have a dataset of two columns: > price amount > 99.5 1 > 99.7 8000 > 1003000 > 100.1 1000 > 100.5 500 > 100.8 1500 > 1052000 > 200100

Re: [SQL] sql

2007-02-05 Thread A. Kretschmer
am Fri, dem 02.02.2007, um 13:09:09 +0530 mailte Shyju Narayanan folgendes: > Hi All > > > BUT I NEED THE RESULT AS > entry_user_id_int COUNT(VC) COUNT(VE) COUNT(CV) COUNT(SC) TOTAL > 781 1 8 1 11 > You need something like this (i called the table foo and without the sc-colum

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

2007-02-05 Thread sneumann
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 := B'0'::bit(len); LINE 1:

[SQL] Getting associated columns with max() without subquery

2007-02-05 Thread César Antonio León Mansilla
Hi, this is my first post, sorry for my english, I'm chilean and my first language is spanish. I don't know if somebody got this solved, but here we go: I was surfing the net for the fastest query that let me to get the max movement from a production plus associated columns related to this produc

Re: [SQL] Insert into a date field

2007-02-05 Thread Hiltibidal, Robert
Try this: '1/9/1963' I'm interpreting your date to be January 9, 1963. -R From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ezequias Rodrigues da Rocha Sent: Friday, February 02, 2007 7:08 AM To: pgsql-sql@postgresql.org Subject: [SQL] I

[SQL] sql

2007-02-05 Thread Shyju Narayanan
Hi All this is my table ; | ID|entry_user_id_int | category_id_chv | -- | 1|78|CV | -- | 2|78|VC | ---

Re: [SQL] Index Anding

2007-02-05 Thread Hiltibidal, Robert
I will investigate this. Our gcc is only able to compile 32 bit. I think I will have to see if I can get/compile a 64 bit gcc I appreciate the help! -R -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Browne Sent: Thursday, February 01, 2007 4:45

[SQL] Search a range of cases/records

2007-02-05 Thread Wei ZOU
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Greetings: I have a dataset of two columns: price amount 99.5 1 99.7 8000 1003000 100.1 1000 100.5 500 100.8 1500 1052000 200100 etc I have to write a SQL query on how many price tags are within [price+-1] such as 98.5 to 100.5,

[SQL] Compilation Error AIX

2007-02-05 Thread Hiltibidal, Robert
I am getting this error 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 -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -I../../../src/include -c

[SQL] Compilation errors

2007-02-05 Thread Hiltibidal, Robert
Is this a good group to post compilation errors to? PRIVILEGED AND CONFIDENTIAL This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the intended recipient or the employee

Re: [SQL] Differentiate Between Zero-Length String and NULLColumn Values

2007-02-05 Thread BillR
Peter Eisentraut wrote: D'Arcy J.M. Cain wrote: SELECT * FROM table WHERE column IS NULL; SELECT * FROM table WHERE column = NULL; The latter violates the SQL spec and is not allowed by PostgreSQL without setting a special flag. It doesn't violate any spec and it's certainly a

Re: [SQL] Index Anding

2007-02-05 Thread Hiltibidal, Robert
This is excellent information Thank you! -Original Message- From: Andrew Sullivan [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 9:53 AM To: Hiltibidal, Robert; pgsql-sql@postgresql.org Subject: Re: Index Anding You probably want to take these questions to the -general list

[SQL] Index Anding

2007-02-05 Thread Hiltibidal, Robert
Good Morning I am considering postgres for a project I am currently using DB2 for. The database is a 200 gb database on db2. The os is AIX 5.2 on a p5 series box with 2 processors and 7 gb ram. I have 300 gb in local scsi mirrored and 300 gb of shark disk raid5. The database

[SQL] Index ANDing & Index ORing

2007-02-05 Thread Hiltibidal, Robert
Does postgres have support for index ANDing and index ORing? Thanks! -Rob PRIVILEGED AND CONFIDENTIAL This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the int

Re: [SQL] Differentiate Between Zero-Length String and NULLColumn Values

2007-02-05 Thread Jamie A Lawrence
Just a datapoint: SQL*Plus: Release 10.1.0.3.0 - Production on Tue Jan 30 15:15:49 2007 Copyright (c) 1982, 2004, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production With the Partitioning, OLAP and Data Mining options SQL> select

Re: [SQL] [ADMIN] Symbol lookup error

2007-02-05 Thread Tom Lane
"Karthikeyan Sundaram" <[EMAIL PROTECTED]> writes: > podcast=> \d channel > psql: symbol lookup error: psql: undefined symbol: PQescapeStringConn It looks like your psql has linked to an obsolete version of libpq.so, though it's not real clear why the thing would have started at all if that were t

[SQL] Symbol lookup error

2007-02-05 Thread Karthikeyan Sundaram
Hi Gurus, I hae installed postgres 8.2 recently and when I open the psql command line prompt and say \d . The psql abort abruptly with an error message given below. What is the cause and how to rectify it? Error Message = Welcome to psql 8.2.1, the PostgreSQL interactive termin