Re: [SQL] Left Join Question

2008-11-18 Thread Richard Huxton
Ryan Wells wrote: > > FROM tasks > LEFT JOIN clients ON tasks.ClientId = clients.ClientId > LEFT JOIN iteminfo ON tasks.Id = iteminfo.ItemId >LEFT JOIN changelog ON tasks.Id = changelog.ItemId > LEFT JOIN ticklers ON tasks.Id = ticklers.RelatedId > WHERE tasks.Id = '123456'; > > (

Re: [SQL] custom serial number

2008-11-18 Thread A. Kretschmer
am Tue, dem 18.11.2008, um 20:56:07 -0800 mailte mahmoud ewiwi folgendes: > Thank you hery much, it works fine with me , but how can i restart the > sequence at the start of each month, or should i do it programatically? Please answer to the list and not to me. You can write a function for that

Re: [SQL] Left Join Question

2008-11-18 Thread Mark Roberts
On Tue, 2008-11-18 at 16:48 -0600, Ryan Wells wrote: > Since it works, my question is really more about principles: Given > that each of the tables in question will contain tens of thousands of > rows, is a nested join really the best way to approach this? I don't see what's wrong with it. The

Re: [SQL] Left Join Question

2008-11-18 Thread ries van Twisk
On Nov 18, 2008, at 5:48 PM, Ryan Wells wrote: While looking through our data layer code today, I ran across this query: SELECT tasks.*, clients.FirstName, clients.LastName, clients.MiddleInitial, iteminfo.CreatedBy, iteminfo.StationId, iteminfo.CreatedDate, changelog.LastModified, changelog

[SQL] Left Join Question

2008-11-18 Thread Ryan Wells
While looking through our data layer code today, I ran across this query: SELECT tasks.*, clients.FirstName, clients.LastName, clients.MiddleInitial, iteminfo.CreatedBy, iteminfo.StationId, iteminfo.CreatedDate, changelog.LastModified, changelog.LastModifiedBy, changelog.LastModified

Re: [SQL] custom serial number

2008-11-18 Thread Gerardo Herzig
A. Kretschmer wrote: > am Tue, dem 18.11.2008, um 1:09:44 -0800 mailte mahmoud ewiwi folgendes: >> hi gurus >> i have a problem in generating serial number with the form mm how >> can i do that? > > test=# create temporary sequence foo; > CREATE SEQUENCE > test=# select to_char(current_

Re: [SQL] custom serial number

2008-11-18 Thread Pavel Stehule
Hello 2008/11/18 A. Kretschmer <[EMAIL PROTECTED]>: > am Tue, dem 18.11.2008, um 10:37:23 +0100 mailte Pavel Stehule folgendes: >> Hello >> >> what do you wont to do exactly? >> >> you can try - >> >> create sequence s; >> postgres=# create sequence s; >> CREATE SEQUENCE >> postgres=# select to_c

Re: [SQL] custom serial number

2008-11-18 Thread A. Kretschmer
am Tue, dem 18.11.2008, um 10:37:23 +0100 mailte Pavel Stehule folgendes: > Hello > > what do you wont to do exactly? > > you can try - > > create sequence s; > postgres=# create sequence s; > CREATE SEQUENCE > postgres=# select to_char(current_date, 'mmdd') || > trim(to_char(nextval('s'),

Re: [SQL] custom serial number

2008-11-18 Thread Pavel Stehule
Hello what do you wont to do exactly? you can try - create sequence s; postgres=# create sequence s; CREATE SEQUENCE postgres=# select to_char(current_date, 'mmdd') || trim(to_char(nextval('s'), '')); ?column? -- 200811180002 (1 row) postgres=# select to_char(current_dat

Re: [SQL] custom serial number

2008-11-18 Thread A. Kretschmer
am Tue, dem 18.11.2008, um 1:09:44 -0800 mailte mahmoud ewiwi folgendes: > hi gurus > i have a problem in generating serial number with the form mm how can > i do that? test=# create temporary sequence foo; CREATE SEQUENCE test=# select to_char(current_date, 'mm')||trim(to_char(next

[SQL] custom serial number

2008-11-18 Thread mahmoud ewiwi
hi gurus i have a problem in generating serial number with the form mm how can i do that? Mahmoud Al-Ewiwi Al-Mahawer Hebron- Palestine -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql