etime
FROM product_move
where datetime < '2012-11-01'
group by product_id
) X
on pm.product_id = X.product_id and pm.datetime = X.datetime
Thus you will know where every product was coming into the period and every
subsequent destination it was moved to within that per
> Sorry, why do you need the joins?
>
> Best,
> Oliver
Strictly speaking, for the examples and results given, the joins are pointless
when you can get all the info from the 'move' table (but then the problem is
like the 'hello world' of SQL)
But then the other 2 tables are completely redundant
roduct p on pm.product_id = p.id inner join
location l on pm.destination_location = l.id
and datetime < '2012-12-31'
I'm not what the use of the 'from' date is in your examples.
Do you need to know the final destination of the product in that time period?
Or every desti
uct_id, l.id as location_id
FROM product_move pm inner join product p on pm.product_id = p.id inner join
location l on pm.destination_location = l.id
and datetime BETWEEN '2010-1-01' AND '2012-12-31'
Regards,
Russell Keane
INPS
Follow us on twitter | visit www.inps.co.uk
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Hi Tom,
Thanks for that, that was exactly the issue.
It absolutely is IMMUTABLE and changing it from VOLATILE has fixed the issue.
Much appreciated,
Russell,
-Original Message-
From: Tom Lane [mailto:t...@sss.pgh.pa.us]
Sent: 26 July 2012 16:52
To: Russell Keane
Cc: pgsql-sql
ove this causes up problems as we have to create all views to point directly
to the table rather than deriving them from other views.
Any ideas?
Regards,
Russell Keane
Registered name: In Practice Systems Ltd.
Registered address: The Bread Factory, 1a Broughton S
values (2, '123456'); --This line fails obviously
Regards,
Russell Keane
INPS
Subscribe to the Vision e-newsletter<http://www.inps4.co.uk/news/enewsletter/>
Subscribe to the Helpline Support
Bulletin<http://www.inps4.co.uk/my_vision/helpline/support-bulletins>
[ci
t_function,
TYPMOD_IN = auto_trunc_char_modifier_in
);
Regards,
Russell Keane
INPS
Subscribe to the Vision e-newsletter<http://www.inps4.co.uk/news/enewsletter/>
Subscribe to the Helpline Support
Bulletin<http://www.inps4.co.uk/my_vision/helpline/support-bulletins>
[cid:image001