Hi
>From is not required if you use literals or function results (with literal
> input parameters).
If you came from Oracle you could simply think that the "FROM DUAL" bit can
be omitted in Postgresql. There may be small differences, but that is the
basic idea.
Bèrto
--
==
>From is not required if you use literals or function results (with literal
>input parameters). If you reference something that is not one of these it has
>to come from somewhere and that location is the from/join part of the query.
In your query foo.work_date is not a literal or function and s
On Saturday, December 17, 2011 8:50:52 am John Fabiani wrote:
> As always I respect your insights - Adrian. I do understand what I did
> wrong in my first attempt at getting my statement to work. But it is
> either over my head or there is something missing. Where is the "from" in
> select now()
As always I respect your insights - Adrian. I do understand what I did wrong
in my first attempt at getting my statement to work. But it is either over my
head or there is something missing. Where is the "from" in
select now()?
I have been using similar SQL statements for years. I never ques
On Friday, December 16, 2011 3:56:48 am John Fabiani wrote:
> I have solved my problem. But this still does not explain the idea of
> "from"
From original query:
..(function_name(303, week_date::date)) as week_date where week_date..
Reason why that did not work:
http://www.postgresql.org/doc
what are u trying to do... But in second
> > > query it seems there is missing "from"
> > >
> > > It is as
> > >
> > > SELECT week-date::date AS week-date WHERE week-date in (subquery which
> > > have from)
> > >
> > > So
ate AS week-date WHERE week-date in (subquery which
> > have from)
> >
> > So week-date column in main query does not exist..
> >
> > Sent from my Windows Phone From: John Fabiani
> > Sent: 16 December 2011 05:16
> > To: pgsql-sql@postgresql.org
&g
me what are u trying to do... But in second
> > query it seems there is missing "from"
> >
> > It is as
> >
> > SELECT week-date::date AS week-date WHERE week-date in (subquery which
> > have from)
> >
> > So week-date column in main query
ave from)
>
> So week-date column in main query does not exist..
>
> Sent from my Windows Phone From: John Fabiani
> Sent: 16 December 2011 05:16
> To: pgsql-sql@postgresql.org
> Subject: [SQL] using a generated series in function
> Hi,
>
> I am attempting (without su
From: John Fabiani
Sent: 16 December 2011 05:16
To: pgsql-sql@postgresql.org
Subject: [SQL] using a generated series in function
Hi,
I am attempting (without success) use the generated series of dates that come
from:
select (cast(date_trunc('week', '2011-11-20'::date ) as da
On Dec 15, 2011, at 23:16, John Fabiani wrote:
> Hi,
>
> I am attempting (without success) use the generated series of dates that come
> from:
> select (cast(date_trunc('week', '2011-11-20'::date ) as date) + (i+6)) as
> week_date from generate_series(0,84,7) i
>
> in a function.
> select fu
Hi,
I am attempting (without success) use the generated series of dates that come
from:
select (cast(date_trunc('week', '2011-11-20'::date ) as date) + (i+6)) as
week_date from generate_series(0,84,7) i
in a function.
select function_name(integer, date); -- function returns a numeric
This do
12 matches
Mail list logo