Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Tom Lane
Daniel CAUNE <[EMAIL PROTECTED]> writes: > How does the IF statement evaluate conditions? Does it evaluate conditions > following their declaration order from left to right? In case of > or-conditions, does the IF statement stop evaluating conditions whenever a > first or-condition is true? > Th

Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Joe
Daniel CAUNE wrote: Hi, How does the IF statement evaluate conditions? Does it evaluate conditions following their declaration order from left to right? In case of or-conditions, does the IF statement stop evaluating conditions whenever a first or-condition is true? Please see 4.2.12. Expr

Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Gregory S. Williamson
Daniel, AFAIK there is no short-circuiting of evaluations in postgres and I don't think you can depend on the order they appear in to determine the order in which they are checked, although more knowledgable people may have better info than I ... so the rewritten form is the way to go. Greg Wi

Re: [SQL] Evaluation of if conditions

2006-09-06 Thread Oisin Glynn
Daniel CAUNE wrote: Hi, How does the IF statement evaluate conditions? Does it evaluate conditions following their declaration order from left to right? In case of or-conditions, does the IF statement stop evaluating conditions whenever a first or-condition is true? The following snippet seem

[SQL] Evaluation of if conditions

2006-09-06 Thread Daniel CAUNE
Hi, How does the IF statement evaluate conditions? Does it evaluate conditions following their declaration order from left to right? In case of or-conditions, does the IF statement stop evaluating conditions whenever a first or-condition is true? The following snippet seems to be invalid, which

Re: [SQL] Substitute a Character

2006-09-06 Thread Daryl Richter
On 9/6/06 12:53 PM, "Judith" <[EMAIL PROTECTED]> wrote: > Hello everybody!! > > I have a field type text with folios like this: A98526 > > but I want to change de A for a 0 like this: 098526, exists a way to > do this in a query??? select translate( 'A98526', 'A', '0' ); transla

Re: [SQL] Substitute a Character

2006-09-06 Thread Chris Mair
> Hello everybody!! > > I have a field type text with folios like this: A98526 > > but I want to change de A for a 0 like this: 098526, exists a way to > do this in a query??? > > Thanks in advanced!!! You should look at these functions: http://www.postgresql.org/docs/8.1

Re: [SQL] Substitute a Character

2006-09-06 Thread Andreas Kretschmer
Judith <[EMAIL PROTECTED]> schrieb: > Hello everybody!! I have a field type text with folios like this: > A98526 > > but I want to change de A for a 0 like this: 098526, exists a way to do > this in a query??? Perhaps something like this: test=# select regexp_replace('A98526', '

[SQL] Substitute a Character

2006-09-06 Thread Judith
Hello everybody!! I have a field type text with folios like this: A98526 but I want to change de A for a 0 like this: 098526, exists a way to do this in a query??? Thanks in advanced!!! ---(end of broadcast)--- TIP 6: explain

Re: [SQL] Query regarding to MS reporting services (Grand total problem)

2006-09-06 Thread Andrew Sullivan
On Tue, Sep 05, 2006 at 10:30:19PM -0700, Dinesh Tiwari wrote: > If any one have idea about this please help me. My idea is that you ask on a list that supports MS SQL Server. This isn't one. A -- Andrew Sullivan | [EMAIL PROTECTED] If they don't do anything, we don't need their acronym.