Re: [SQL] please help me on regular expression

2010-02-03 Thread Lars Gustafsson
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. — Jamie Zawinski 3 feb 2010 kl. 21.32 skrev Tena Sakai: > Thank you, Dirk. > > Regards, > > Tena Sakai > tsa...@gallo.ucsf.edu > > > On 2/3/10 11:43 AM, "Dirk Jagdmann" wro

Re: [SQL] please help me on regular expression

2010-02-03 Thread Tena Sakai
Thank you, Dirk. Regards, Tena Sakai tsa...@gallo.ucsf.edu On 2/3/10 11:43 AM, "Dirk Jagdmann" wrote: > Be careful when working with backslashes and regular expressions for > the proper (double) escaping! > > # select '70a5' ~ e'\\d+\.\\d+'; > ?column? > -- > t > (1 row) > > # sel

Re: [SQL] please help me on regular expression

2010-02-03 Thread Dirk Jagdmann
Be careful when working with backslashes and regular expressions for the proper (double) escaping! # select '70a5' ~ e'\\d+\.\\d+'; ?column? -- t (1 row) # select '70a5' ~ e'\\d+\\.\\d+'; ?column? -- f (1 row) # select '70.5' ~ e'\\d+\\.\\d+'; ?column? -- t -- ---

Re: [SQL] please help me on regular expression

2010-02-03 Thread Tena Sakai
Hi, Thanks for your reply. Indeed, why not? Tena Sakai tsa...@gallo.ucsf.edu On 2/3/10 3:38 AM, "msi77" wrote: > Why not to use > > select subjectid, height > from tsakai.pheno > where height like '%.%'; > > ? > >> Hi everybody, >> I need a bit of help on postgres reqular expression. >>

Re: [SQL] please help me on regular expression

2010-02-03 Thread msi77
Why not to use select subjectid, height from tsakai.pheno where height like '%.%'; ? > Hi everybody, > I need a bit of help on postgres reqular expression. > With a table of the following definition: > Table "tsakai.pheno" > Column | Type | Modifiers > ---+---+

Re: [SQL] please help me on regular expression

2010-02-02 Thread Tena Sakai
Thank you kindly, Pavel. Regards, Tena Sakai On 2/2/10 12:38 PM, "Pavel Stehule" wrote: > 2010/2/2 Tena Sakai : >> Hi everybody, >> >> I need a bit of help on postgres reqular expression. >> With a table of the following definition: >> >>           Table "tsakai.pheno" >>  Column   |      

Re: [SQL] please help me on regular expression

2010-02-02 Thread Pavel Stehule
2010/2/2 Tena Sakai : > Hi everybody, > > I need a bit of help on postgres reqular expression. > With a table of the following definition: > >           Table "tsakai.pheno" >  Column   |       Type        | Modifiers > ---+---+--- >  subjectid | integer           |

[SQL] please help me on regular expression

2010-02-02 Thread Tena Sakai
Hi everybody, I need a bit of help on postgres reqular expression. With a table of the following definition: Table "tsakai.pheno" Column | Type| Modifiers ---+---+--- subjectid | integer | not null height| character vary

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-28 Thread Alvaro Herrera
andi wrote: > I have seen this is very drawback of our beloved postgres databases, > postgres do not support sql 2003 standards, > > I hope soon we can support this standards. Hmm. True. It is also true that we'll be there sooner if you help out. -- Alvaro Herrera

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-28 Thread andi
Dear friends,   I have seen this is very drawback of our beloved postgres databases, postgres do not support sql 2003 standards,  I hope soon we can support this standards.   Thank you  

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-27 Thread Jesper K. Pedersen
Andrew Sullivan wrote: On Fri, May 26, 2006 at 05:11:26PM +0700, andi wrote: select rank() over(order by testeridpk ) as rank , * from tester; I get the result is like this, RANK TESTERIDPK TESTER_NAME 1 10TESSS 2 90NAMAAA 3

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-26 Thread Andrew Sullivan
On Fri, May 26, 2006 at 09:08:20AM -0500, Bruno Wolff III wrote: > > Rollbacks will not reset sequence values. Use setval to do that. No, what I posted was the CREATE SEQUENCE after the BEGIN. ROLLBACK gets rid of the sequence. The next time you create the same sequence, therefore, it also star

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-26 Thread Bruno Wolff III
On Fri, May 26, 2006 at 06:50:37 -0400, Andrew Sullivan <[EMAIL PROTECTED]> wrote: > On Fri, May 26, 2006 at 05:11:26PM +0700, andi wrote: > > select rank() over(order by testeridpk ) as rank , * from tester; > > > > I get the result is like this, > > > > > > RANK TESTERIDPK TESTER_NA

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-26 Thread Andrew Sullivan
On Fri, May 26, 2006 at 05:11:26PM +0700, andi wrote: > select rank() over(order by testeridpk ) as rank , * from tester; > > I get the result is like this, > > > RANK TESTERIDPK TESTER_NAME > > 1 10TESSS > > 2 90NAMAAA > > 3 100

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-26 Thread andi
When  I use this syntax select * from TESTER; I got   TESTERIDPK  TESTER_NAME 10  TE 90     NAM 100 U   In ms sql server 2005 I use this select rank() over(order by testeridpk ) as rank , * from tester; I get the result is like this,   RAN

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-24 Thread Richard Huxton
andi wrote: Dear friends, I have table MD_CUSTOMER MD_CUSTOMERIDPK integer primary key NAME varchar OK - two columns. But my primary key is not in correct order like MD_CUSTOMER MD_CUSTOMERIDPK NAME 10 ANDI 33 TESTER 100

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-24 Thread Franco Bruno Borghesi
Well, you could add a serial column. I'll tell you how, but I haven't tested the code, so be sure to check it! And using BEGIN and COMMIT/ROLLBACK to delimit transactions would not be a bad idea at all ;-)To add a serial column, just write: --create new serial field ALTER TABLE md_customer ADD id

Re: [SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-24 Thread Andrew Sullivan
On Wed, May 24, 2006 at 05:35:10PM +0700, andi wrote: > > But my primary key is not in correct order like What does this mean? Is the key being generated by a sequence (i.e. is the column DEFAULT nextval('some_sequence'))? If so, the primary key will be assigned in COMMIT order. Note that the

[SQL] PLEASE help ME , HOW TO GENERATE PRIMARY Keys on the fly

2006-05-24 Thread andi
Dear friends,   I have table MD_CUSTOMER MD_CUSTOMERIDPK integer primary key NAME   varchar     But my primary key is not in correct order like MD_CUSTOMER MD_CUSTOMERIDPK NAME 10 

Re: [SQL] Please help me.. problem in to_char

2004-07-21 Thread azah azah
Thanks all, :) It working now, i'm using code as below: to_char(t1.created::date,'DD/MM/') but other problem come out, error as below: ERROR: relation "plugins" does not exist what that's mean?? table plugins already exists.. On Thu, 22 Jul 2004 10:43:35 +0800, azah azah <[EMAIL PROTECT

Re: [SQL] Please help me.. problem in to_char

2004-07-21 Thread azah azah
Why still not working??? I have try all the suggestions, still error like below: ERROR: cannot cast type character varying to date I'm using latest version of postresql. On Wed, 21 Jul 2004 05:35:06 -0700 (PDT), Theodore Petrosky <[EMAIL PROTECTED]> wrote: > > what kind of column is t1.created?

Re: [SQL] Please help me.. problem in to_char

2004-07-21 Thread Theodore Petrosky
what kind of column is t1.created? It appears that it is a text column and the format looks like a date. Is this correct or is it a date? I need more information about your table structure. What about: SELECT t2.id, t2.name, to_char(cast (t1.created as date),'DD/MM/') but the other '::' sh

Re: [SQL] Please help me.. problem in to_char

2004-07-21 Thread Markus Bertheau
Ð ÐÑÐ, 21.07.2004, Ð 10:33, azah azah ÐÐÑÐÑ: > Hi, > I want convert from mysql to postresql, previously > in mysql the code as below: > > SELECT t2.id, t2.name, date_format(t1.created,\'%W %M %e, %Y - %r\') > > In postresql no date_format function, we need to use to_char function > but it still

[SQL] Please help me.. problem in to_char

2004-07-21 Thread azah azah
Hi, I want convert from mysql to postresql, previously in mysql the code as below: SELECT t2.id, t2.name, date_format(t1.created,\'%W %M %e, %Y - %r\') In postresql no date_format function, we need to use to_char function but it still work because still need to put ::date such as SELECT to_char

Re: [SQL] please help me with text cast to int ....

2004-07-11 Thread Theodore Petrosky
Thank you this pointed me to the problem. I have non castable entries. I had picked up legacy data (for the jobnumbers [that's why they were text in the first place]) and some of the jobnumbers where 1162_01 1162_02 so this would fail. The error message was giving me the correct message h

Re: [SQL] please help me with text cast to int ....

2004-07-11 Thread Stephan Szabo
On Sun, 11 Jul 2004, Theodore Petrosky wrote: > I give up.. what don't I understand about casting and > ints and text.. > > i have a table jobinfo with: > > acode text, > jobnumber text default > nextval('public.jobinfo_seq'::text), > jobtitle text > > I have about 3000 rows starting with jobnumb

Re: [SQL] please help me with text cast to int ....

2004-07-11 Thread Phil Endecott
Theodore, Because jobnumber is declared as text, you are getting "dictionary order" (lexicographic) ordering on the values. In a dictionary, "abc" comes after "a", obviously. So indeed "999" will come after "1000". To get the effect that you want you need to treat jobnumber as a numb

[SQL] please help me with text cast to int ....

2004-07-11 Thread Theodore Petrosky
I give up.. what don't I understand about casting and ints and text.. i have a table jobinfo with: acode text, jobnumber text default nextval('public.jobinfo_seq'::text), jobtitle text I have about 3000 rows starting with jobnumber = 1000. SELECT jobnumber, jobtitle FROM jobinfo WHERE jobnumb

Re: [SQL] Please help me to slove this SQL statements

2003-11-05 Thread Patrick JACQUOT (DSI NOISIEL)
-Message d'origine- De : Freshman [mailto:[EMAIL PROTECTED] Envoyé : jeudi 30 octobre 2003 13:38 À : [EMAIL PROTECTED] Objet : [SQL] Please help me to slove this SQL statements There are three table in database which is suppliers, projects, and shipments suppliers contain supplie

[SQL] Please help me to slove this SQL statements

2003-11-04 Thread Freshman
There are three table in database which is suppliers, projects, and shipments suppliers contain suppliers id, name ...etc projects contain project name ..suppliers ID ( J1---J7) ...etc shipments table contain suppliers ID , PROJECTS ID how can i query to find out the suppliers to supply all the pr

[SQL] please help me ???

2003-05-30 Thread andhie lala
Dear All I'am a new user in postgresql, i want to ask about : 1. The one who is intended with STORED PROCEDURE, how its implement and what its surplus. Version POSTGRESQL that how much possess STRORED PROCEDURE. 2. In when I make the function as follows: CREATE FUNCTION forward(C

Re: [SQL] Please Help me

2002-08-02 Thread Jochem van Dieten
Michelle Murrain wrote: > > Yeah, except I do have experience with ColdFusion, and ColdFusion > runs into some very problematic issues with Postgres, sadly. Although > I use Postgres almost exclusively, I had to switch to MySQL for use > with ColdFusion. I wonder what your issues are, because in

Re: [SQL] Please Help me

2002-08-01 Thread Christopher Kings-Lynne
Title: Re: [SQL] Please Help me Michelle,   Have you tried it with Postgres 7.1 yet, which removed such limitations?   Chris -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michelle MurrainSent: Thursday, 1 August 2002 10:48 PMTo: Chad

Re: [SQL] Please Help me

2002-08-01 Thread Chad Thompson
Title: Re: [SQL] Please Help me Unfortunatly i know of no such problem.  I have large text fields being submited to my database, but i restrict the submit page to 255 chars.  I will have to test larger numbers and see what errors i get.   Thanks Chad - Original Message - From

Re: [SQL] Please Help me

2002-08-01 Thread Michelle Murrain
Title: Re: [SQL] Please Help me At 8:32 AM -0600 8/1/02, Chad Thompson wrote: I am running RedHat, with Apache and Cold Fusion.  I chose PostgreSQL for all of the aforementioned reasons.  It works very well with Cold Fusion.  I have done some optimizing and am able to run rather complex queries

Re: [SQL] Please Help me

2002-08-01 Thread Chad Thompson
had to bail on MySQL because it wouldnt run the sub-queries that i needed.   Thanks Chad - Original Message - From: Waheed Rahuman To: [EMAIL PROTECTED] Sent: Thursday, August 01, 2002 11:10 AM Subject: [SQL] Please Help me Dear all Please suggest me which

Re: [SQL] Please Help me

2002-08-01 Thread Michelle Murrain
Title: Re: [SQL] Please Help me At 2:49 PM +0800 8/1/02, Christopher Kings-Lynne wrote: I have no experience with ColdFusion, but if you ask a question like whether MySQL or Postgres is better on a Postgres mailing list - we're going to say Postgres. Yeah, except I do have experience

Re: [SQL] Please Help me

2002-07-31 Thread Christopher Kings-Lynne
ural languages * ...and much, much more...   You haven't provided us with very much information, however...   Chris -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Waheed RahumanSent: Friday, 2 August 2002 1:11 AMTo: [EMAIL PROTECTED]Subject: [SQL

[SQL] Please Help me

2002-07-31 Thread Waheed Rahuman
Dear all Please suggest me which database i can choose for my server setup like   1. Manrake Linux 2. ColdFusion 3. Apache Webserver   Now i dont know which database to choose Whether MySQL or PostgreSQL Please suggest me a. Thank you Expecting your reply Regards Waheed Rahuman      

Re: [SQL] Please help me out on this insert error

2002-06-13 Thread Vernon Wu
6/14/2002 6:31:16 AM, Stephan Szabo <[EMAIL PROTECTED]> wrote: > >On Thu, 13 Jun 2002, Vernon Wu wrote: > >> I, however, didn't use double quote mark when I created the table at all. > >If you used an interface to generate the table def, alot of them add the >quote marks behind your back when the

Re: [SQL] Please help me out on this insert error

2002-06-13 Thread Vernon Wu
You are right, Steve. It needs the double quote mark. After I use the double quote mark, an error message is: ERROR: ExecAppend: Fail to add null value in not null attribute ... which is right since I don't have non-null value to non-null field yet. I, however, didn't use double quote mark w

Re: [SQL] Please help me out on this insert error

2002-06-13 Thread Manfred Koizar
On Thu, 13 Jun 2002 13:16:29 +0800, Vernon Wu <[EMAIL PROTECTED]> wrote: > >Command: > >Insert into profile (userid, haveChildren)values('id98', 'No'); > >Error: > >ERROR: Relation 'profile' does not have attribute 'havaChildren' ^

Re: [SQL] Please help me out on this insert error

2002-06-13 Thread Stephan Szabo
On Thu, 13 Jun 2002, Vernon Wu wrote: > > Command: > > Insert into profile (userid, haveChildren)values('id98', 'No'); You presumably used double quotes when creating the column, so you need to use them to refer to the column from that point on: insert into profile(userid, "haveChildren") ...

Re: [SQL] Please help me out on this insert error

2002-06-13 Thread Stephan Szabo
On Thu, 13 Jun 2002, Vernon Wu wrote: > I, however, didn't use double quote mark when I created the table at all. If you used an interface to generate the table def, alot of them add the quote marks behind your back when they do the creation. In general, it's safer to just use all lowercase nam

Re: [SQL] Please help me out on this insert error

2002-06-13 Thread Joe Conway
Vernon Wu wrote: > Command: > > Insert into profile (userid, haveChildren)values('id98', 'No'); > > Error: > > ERROR: Relation 'profile' does not have attribute 'havaChildren' ^^^ From the error message, looks like you spelled haveChild

[SQL] Please help me out on this insert error

2002-06-13 Thread Vernon Wu
Command: Insert into profile (userid, haveChildren)values('id98', 'No'); Error: ERROR: Relation 'profile' does not have attribute 'havaChildren' Table: Table "profile" Column| Type | Modifiers --+---+-- useri