Re: [SQL] pgsql multi-database queries

2004-04-09 Thread scott.marlowe
On Thu, 8 Apr 2004, yek ching wrote: > Dear Sir/Miss, > > Is there a way to do a multi-database select query??.. I fail to find the > related solution... currently i i created seperate table call stockmaster > under seperate database for each seperate organizations... When i want to > queries

Re: [SQL] SQL challenge--top 10 for each key value?

2004-04-09 Thread Rod Taylor
On Fri, 2004-04-09 at 18:43, Greg Stark wrote: > Josh Berkus <[EMAIL PROTECTED]> writes: > > > Rod, > > > > > Something along the lines of the below would accomplish what you want > > > according to spec. ROW_NUMBER() is a spec defined function. (6.10 of > > > SQL200N) > > > > Great leaping litt

Re: [SQL] Counting rows from two tables in one query

2004-04-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

Re: [SQL] Crypt() encryption

2004-04-09 Thread Bruce Momjian
Christina Zhang wrote: > Hello, > > We are planning to use Crypt() to encrypt the application level > users' passwords. Our question is that which encryption method > the Crypt() is using? (DES, or some other encryption algorithms?) > Because we concern about the strenth of the Crypt(). Use MD5.

[SQL] hi sir urgent..required a Query

2004-04-09 Thread Rajeev Chaudhary, Noida
Hi Sir, I am attaching a document with this file showing two table.. <> It consist of two table VALUE AND VALUE_TYPE.. when i have value_type_id=1 i must get Value_varchar column value when i have value_type_id=2 i must get Value_int column value Please send a SQL query for this... I want to

[SQL] pgsql multi-database queries

2004-04-09 Thread yek ching
Dear Sir/Miss, Is there a way to do a multi-database select query??.. I fail to find the related solution... currently i i created seperate table call stockmaster under seperate database for each seperate organizations... When i want to queries out the stock item qty for multi database, i face

Re: [SQL] Help with COPY command

2004-04-09 Thread Tony Reina
Ok. I found the libpq syntax for COPY in the Programmer's manual. I've got a working version, but wanted to verify something. PQexec(conn, "COPY foo FROM STDIN"); PQputline(conn, "3\thello world\t4.5\n"); PQputline(conn,"4\tgoodbye world\t7.11\n"); ... PQputline(conn,"\\.\n"); PQendcopy(conn); 1.

[SQL] Crypt() encryption

2004-04-09 Thread Christina Zhang
Hello, We are planning to use Crypt() to encrypt the application level users' passwords. Our question is that which encryption method the Crypt() is using? (DES, or some other encryption algorithms?) Because we concern about the strenth of the Crypt(). Thanks for your input. Christina --

[SQL] Counting rows from two tables in one query

2004-04-09 Thread Stefan Weiss
Hi. I have a (simplified) table layout like this: +-+ +-+ | sub_a | +--+ | sub_b | +-+ | main | +-+ | id | +--+ | id | | main_id |

[SQL] setting a non-standard date format for the duration of a session

2004-04-09 Thread Cris Carampa
I understand I can use the function to_date(s,f) for converting a string into a date using a non-standard format. I'm wondering if there is a way to set a non-standard date format for the duration of a session, something like the "ALTER SESSION SET NLS_DATE_FORMAT='f'" Oracle statement. Thank you.

Re: [SQL] Unknown Exception (piaozhenyu@163.com)

2004-04-09 Thread ??
?? - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 12:46 PM Subject: Unknown Exception ([EMAIL PROTECTED]) > > Mail Transaction Failed - This mail couldn't be converted > > - failed message - > d9H_,ac,IAdU'Qha

[SQL] Help with COPY command

2004-04-09 Thread Tony Reina
I'm attempting to use the COPY command through the libpq C functions. In the psql command line editor, I'd have the following commands: COPY testtable FROM stdin WITH DELIMITER ','; 1, 2, 'a', 3, 4 5, 6, 'b', 7, 8 9, 10, 'c', 11, 12 \. My question is: Does this all have to be passed as one big

Re: [SQL] SQL challenge--top 10 for each key value?

2004-04-09 Thread Greg Stark
Josh Berkus <[EMAIL PROTECTED]> writes: > Rod, > > > Something along the lines of the below would accomplish what you want > > according to spec. ROW_NUMBER() is a spec defined function. (6.10 of > > SQL200N) > > Great leaping little gods! They added something called "row number" to the > spe

Re: [SQL] Utility of recursive queries?

2004-04-09 Thread Tom Lane
James Robinson <[EMAIL PROTECTED]> writes: > Given a reference to id=3, would a recursive query be the trick to > unrolling the list to discover id=1 as the head using a SQL one-liner? I think you could do it, but don't have the syntax in my head. > would any potential recursive query implement

Re: [SQL] Utility of recursive queries?

2004-04-09 Thread Josh Berkus
James, > Would recursive queries be the trick to doing things like unwinding a > linked-list to either the head or tail, with: Yes. Also check out contrib/ltree and contrib/tablefunc in your handy-dandy PostgreSQL source code. -- Josh Berkus Aglio Database Solutions San Francisco ---

Re: [SQL] SQL challenge--top 10 for each key value?

2004-04-09 Thread Josh Berkus
Rod, > Something along the lines of the below would accomplish what you want > according to spec. ROW_NUMBER() is a spec defined function. (6.10 of > SQL200N) Great leaping little gods! They added something called "row number" to the spec? Boy howdy, folks were right ... the ANSI committee r

[SQL] Utility of recursive queries?

2004-04-09 Thread James Robinson
Would recursive queries be the trick to doing things like unwinding a linked-list to either the head or tail, with: create table list ( id int primary key, parent int references list(id) ); insert into list values (1, null); -- head of

Re: [SQL] could not devise a query plan

2004-04-09 Thread SZŰCS Gábor
Dear Tom, I didn't get your replies, but found them in the archives. Thanks a lot, the patched 7.4 works with the original query! (didn't patch 7.3 since it's a production db, and it works in 7.3 anyway) Thanks again, Yours, G. %--- cut here ---% \end ---