Re: [SQL] need help

2013-02-22 Thread Russell Keane
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 in

Re: [SQL] need help

2013-02-22 Thread Russell Keane
' 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 period. (although I'm still not sure this is what you want) Regards, Russell Keane

Re: [SQL] need help

2013-02-21 Thread Russell Keane
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

Re: [SQL] need help

2013-02-21 Thread Russell Keane
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 destination location of the product in that time period? Regards, Russell Keane INPS Follow us on twitter | visit www.inps.co.uk -- Sent via pgsql-sql mailing

Re: [SQL] FW: view derived from view doesn't use indexes

2012-07-27 Thread Russell Keane
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

[SQL] FW: view derived from view doesn't use indexes

2012-07-26 Thread Russell Keane
them from other views. Any ideas? Regards, Russell Keane Registered name: In Practice Systems Ltd. Registered address: The Bread Factory, 1a Broughton Street, London, SW8 3QJ Registered Number: 1788577 Registered in England Visit our Internet Web site

[SQL] Updatable view should truncate table fields

2011-11-08 Thread Russell Keane
, '123456'); --This line fails obviously Regards, Russell Keane INPS Subscribe to the Vision e-newsletterhttp://www.inps4.co.uk/news/enewsletter/ Subscribe to the Helpline Support Bulletinhttp://www.inps4.co.uk/my_vision/helpline/support-bulletins [cid:image003.png@01CC9E5E.26083BD0] Subscribe

[SQL] Create Type with typmod_in

2011-11-04 Thread Russell Keane
, TYPMOD_IN = auto_trunc_char_modifier_in ); Regards, Russell Keane INPS Subscribe to the Vision e-newsletterhttp://www.inps4.co.uk/news/enewsletter/ Subscribe to the Helpline Support Bulletinhttp://www.inps4.co.uk/my_vision/helpline/support-bulletins [cid:image001.png@01CC9AFA.4BF01AF0] Subscribe