[SQL] Problem with FOR UPDATE

2006-09-07 Thread Kaloyan Iliev
Hi All, I have a query in which I want to SELECT FOR UPDATE same rows but only from one table. Firs I try just with SELECT FOR UPDATE but I receive an error because of the LEFT JOIN - "ERROR: SELECT FOR UPDATE/SHARE cannot be applied to the nullable side of an outer join". So I decide to use S

Re: [SQL] Substitute a Character

2006-09-07 Thread Kaloyan Iliev
Hi, Try: UPDATE foe SET field = regexp_replace(field, '^.', '0'); OR UPDATE foe SET field = regexp_replace(field, 'A', '0'); This will replace in table "foe" in the column "field" 'A' with '0'; Regards, Kaloyan Iliev Judith wrote: Hello everybody!! I have a field type text with foli

Re: [SQL] Postgres regexp matching failure?

2006-09-07 Thread Mario Splivalo
On Tue, 2006-09-05 at 11:22 -0400, Tom Lane wrote: > Mario Splivalo <[EMAIL PROTECTED]> writes: > > So, I guess it's obvious that postgres doesn't treat regular expressions > > the same way as java/perl/pyton/php/awk/sed do... > > When you get into stuff as arcane as word-boundary constraints, you

[SQL] Is it possible to left join based on previous joins result

2006-09-07 Thread Emi Lu
Hello, Is it possible to do something like: select ... from t1 inner join t2 ... left join t2.colN When t1 inner join with t2 I got unique result for t2.colN( colN's value is table name). Can I continue to left join with the column "colN" in table t2? Thanks ---(

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

2006-09-07 Thread Aaron Bono
On 9/6/06, Dinesh Tiwari <[EMAIL PROTECTED]> wrote: Hi, I have a problem reagarding Grand Total in the table footer. I am showing only top 10 seeling for each department in report but i want sum of whole table seelings in table footer. not only 10 sellings which are shown in report. I want the su

Re: [SQL] Is it possible to left join based on previous joins result

2006-09-07 Thread Emi Lu
I tried the example as the following: create table a(col1); create table b(col1, col2) select a.* from a inner join b using(col2) left join b.col2 as c on (c.col1 = a.col1) System notifies me that b is not a schema name. So, I guess the approach that I tried to do is not acceptable by Pgsql g

Re: [SQL] Problem with FOR UPDATE

2006-09-07 Thread Tom Lane
Kaloyan Iliev <[EMAIL PROTECTED]> writes: > rsr=# SELECT > ... > rsr-#FROM debts_desc DD LEFT JOIN config > C ON (DD.conf_id = C.id), > ... > rsr-#FOR UPDATE OF > debts_desc; > ERROR: relation "debts_desc" in FOR

Re: [SQL] Problem with FOR UPDATE

2006-09-07 Thread Stephan Szabo
On Thu, 7 Sep 2006, Kaloyan Iliev wrote: > Hi All, > I have a query in which I want to SELECT FOR UPDATE same rows but only > from one table. > Firs I try just with SELECT FOR UPDATE but I receive an error > because of the LEFT JOIN - "ERROR: SELECT FOR UPDATE/SHARE cannot be > applied to the nu

Re: [SQL] Is it possible to left join based on previous joins result

2006-09-07 Thread Stephan Szabo
On Thu, 7 Sep 2006, Emi Lu wrote: > Hello, > > Is it possible to do something like: > > select ... > from t1 > inner join t2 ... > left join t2.colN > > When t1 inner join with t2 I got unique result for t2.colN( colN's value > is table name). > > Can I continue to left join with the column "colN"

Re: [SQL] Is it possible to left join based on previous joins

2006-09-07 Thread Ragnar
On fim, 2006-09-07 at 10:02 -0400, Emi Lu wrote: > I tried the example as the following: > > create table a(col1); > create table b(col1, col2) > > select a.* > from a inner join b using(col2) > left join b.col2 as c on (c.col1 = a.col1) > > System notifies me that b is not a schema name. > > S

[SQL] Thanks

2006-09-07 Thread Kaloyan Iliev
Thanks a lot! It works! Regards,   Kaloyan Iliev Tom Lane wrote: Kaloyan Iliev <[EMAIL PROTECTED]> writes: rsr=# SELECT ... rsr-#FROM debts_desc DD LEFT JOIN config C ON (DD.conf_id = C.id), ... rsr-#