Re: [SQL] table joining duplicate records

2006-07-08 Thread Richard Broersma Jr
> can i have a result set. just like the outer join returns. > but on my case. return null on duplicates. > like this one. > > survey :category :question :answer > --- > survey1:category1:question1:answer1 >: : :answer2 hmmm.. I am no sure

Re: [SQL] SELECT substring with regex

2006-07-08 Thread Rodrigo De Leon
On 7/8/06, T E Schmitz <[EMAIL PROTECTED]> wrote: Is regexp_replace a new feature? I am running v 7.4. Given the patch history: http://archives.postgresql.org/pgsql-patches/2004-07/msg00471.php http://archives.postgresql.org/pgsql-patches/2005-06/msg00515.php http://archives.postgresql.org/pgs

Re: [SQL] SELECT substring with regex

2006-07-08 Thread T E Schmitz
Aaron Bono wrote: On 7/7/06, *T E Schmitz* <[EMAIL PROTECTED] > wrote: I am trying to come up with a semi-automatic solution to tidy up some data. If it's got to be done manually via the GUI it would mean a lot of dummy work [for the customer]. I would r

Re: [SQL] Celko's Puzzle Number 5

2006-07-08 Thread Richard Broersma Jr
> http://www.postgresql.org/docs/8.1/interactive/functions-matching.html > > Any of these CHECK expressions should work: > > CHECK (alpha_only SIMILAR TO '[A-Za-z]+') > CHECK (alpha_only ~ '^[A-Za-z]+$') > CHECK (alpha_only ~* '^[a-z]+$') > > Unfortunately, even though SIMILAR TO has been

Re: [SQL] table joining duplicate records

2006-07-08 Thread Richard Broersma Jr
> --query results-- > survey :category :question :answer > survey1:category1:question1:answer1 > survey1:category1:question1:answer2 > > how can i elimate duplicates on my query results? > an also am i using the right 'table joining' or table design for my > survey app? What duplicates? You hav

Re: [SQL] Celko's Puzzle Number 5

2006-07-08 Thread Michael Fuhr
On Fri, Jul 07, 2006 at 11:34:57PM -0700, Richard Broersma Jr wrote: > "How do you ensure that a column will have a single alphabetic > character string in it? (That means no spaces, no numbers, and > no special characters.)" You can check patterns with regular expressions. PostgreSQL supports SI

[SQL] unsubscribe

2006-07-08 Thread Patrice OLIVER
unsubscribe ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [SQL] table joining duplicate records

2006-07-08 Thread Anthony Kinyage
In your case Survey , Categories, Questions and Answers TABLES are parents tables, and Question_answers TABLE is a Child Table.   Since you want to have survery, from Survey Table, Category from Category Table, Question from Question Table and Answer from Answer Table and alll these Atributes ar

Re: [SQL] SELECT substring with regex

2006-07-08 Thread T E Schmitz
Rodrigo De Leon wrote: On 7/7/06, T E Schmitz <[EMAIL PROTECTED]> wrote: Sorry, but that would also capture something like 10-30-59mm The pattern describes either a single length (120 millimeters) or a range (30 to 70 millimetres), hence: \\d+(-\\d+)?mm The ? quantifier refers to the combina

[SQL] table joining duplicate records

2006-07-08 Thread onin
hi all, somebody please help me with my sql statement. or point me to the right documentation that i need to read. what i want to working on right now is to create a db for a survey app my tables look this surveys survey_id:survey 1: survey1 categories category_id:cate

[SQL] (no subject)

2006-07-08 Thread onin
-- "A whim, a thought, and more is sought... awake, my mind... thy will be wrought!" ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings