I've got a join where a certain column name appears twice:
select username,last_name from eg_member join eg_membership using
(member_id) join eg_account using (account_id) join eg_person using
(person_id);
ERROR: common column name "person_id" appears more than once in left table
My first incli
Bryce Nesbitt escribió:
I've got a join where a certain column name appears twice:
select username,last_name from eg_member join eg_membership using
(member_id) join eg_account using (account_id) join eg_person using
(person_id);
ERROR: common column name "person_id" appears more than once in l
Bryce Nesbitt <[EMAIL PROTECTED]> writes:
> I've got a join where a certain column name appears twice:
> select username,last_name from eg_member join eg_membership using
> (member_id) join eg_account using (account_id) join eg_person using
> (person_id);
> ERROR: common column name "person_id" ap
Hmm. Seemed so simple. But how do I get the number of years an
interval represents? extract is clearly the wrong way:
stage=# select 'now()-'1987-02-01' as interval,extract(year from
now()-'1987-02-01') as age;
interval | age
--+-
7665 days 18:05:51.
On Sunday 27 January 2008 6:30 pm, Bryce Nesbitt wrote:
> Hmm. Seemed so simple. But how do I get the number of years an
> interval represents? extract is clearly the wrong way:
>
> stage=# select 'now()-'1987-02-01' as interval,extract(year from
> now()-'1987-02-01') as age;
> interval
Bryce Nesbitt <[EMAIL PROTECTED]> writes:
> Hmm. Seemed so simple. But how do I get the number of years an
> interval represents? extract is clearly the wrong way:
There is nothing simple about datetime calculations, ever :-(
Let me exhibit why this particular case is not as simple as you
coul
Sigh. Ok, I settled on:
select '1987-01-29'::timestamp + interval '21 years'
> now();
Which is closer to what I wanted anyway (this was all about determining
who was under 21 years old). This at least should be robust over leap
years.
Tom Lane wrote:
There is nothing simple about datetim
On Jan 27, 2008, at 23:51 , Bryce Nesbitt wrote:
Sigh. Ok, I settled on:
select '1987-01-29'::timestamp + interval '21 years' > now();
Which is closer to what I wanted anyway (this was all about
determining who was under 21 years old). This at least should be
robust over leap years.
I th
Dear All, I am currently using PostgreSQL database version 8.0.13. My problem relates to a slow result when a query using a defined view joins to another table for a result. Background: I have 7 tables of invoice transactions. The tables are slightly different in that they record different dat