Re: [SQL] current_date vs 'now'

2009-02-05 Thread Tom Lane
Jamie Tufnell writes: > AFAIK current_date is standard and 'now' and 'today', etc are not... > so that's one reason to continuing using current_date. However, I > wonder why 'today' and current_date don't generate the same query > plan? 'today'::date is a special string that is recognized by the

[SQL] Must I use DISTINCT?

2009-02-05 Thread Michael B Allen
Please consider the following SQL SELECT e.eid, e.name FROM entry e, access a WHERE e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) The intent is to match one entry with the eid of 120. However I would like to impose an additional constraint that either e.ownid must be 66 or e.aid must ma

Re: [SQL] current_date vs 'now'

2009-02-05 Thread Jamie Tufnell
On 2/6/09, Tom Lane wrote: > As the view definition printout suggests, tomorrow this view will produce > > 2009-02-06 | 2009-02-05 > > because the constant isn't going to change. Thanks for that explanation Tom. Very clear and helpful. Jamie -- Sent via pgsql-sql mailing list (pgsql-sql@post

Re: [SQL] Array iterator

2009-02-05 Thread Raj Mathur
On Tuesday 27 Jan 2009, Achilleas Mantzios wrote: > Στις Tuesday 27 January 2009 14:40:29 ο/η Raj Mathur έγραψε: > > select regexp_split_to_array('string with tokens', '[^A-Za-z0-9]'); > > maybe > select regexp_split_to_table('string with tokens', '[^A-Za-z0-9]'); > would help? That did the job, t

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Rajesh Kumar Mallah
have you tried Join using , eg SELECT e.eid, e.name FROM entry e join access a ON( e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) ) ; some sample data might also help in understanding the prob more clrearly. regds rajesh kumar mallah. On Fri, Feb 6, 2009 at 3:27 AM, Michael B Allen wro

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Michael B Allen
On Thu, Feb 5, 2009 at 10:59 PM, Rajesh Kumar Mallah wrote: > have you tried Join using , eg > SELECT e.eid, e.name > FROM entry e join access a ON( e.eid = 120 > AND (e.ownid = 66 OR e.aid = a.aid) ) ; > > some sample data might also help in understanding the prob > more clrearly. Hi Rajes

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Stephan Szabo
On Thu, 5 Feb 2009, Michael B Allen wrote: > Please consider the following SQL > > SELECT e.eid, e.name > FROM entry e, access a > WHERE e.eid = 120 > AND (e.ownid = 66 OR e.aid = a.aid) > > The intent is to match one entry with the eid of 120. However I would > like to impose an addition

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Raj Mathur
On Friday 06 Feb 2009, Michael B Allen wrote: > On Thu, Feb 5, 2009 at 10:59 PM, Rajesh Kumar Mallah > > wrote: > > have you tried Join using , eg > > SELECT e.eid, e.name > > FROM entry e join access a ON( e.eid = 120 > > AND (e.ownid = 66 OR e.aid = a.aid) ) ; > > > > some sample data migh