Snippets

Run SQL scripts

Member for

4 years 5 months
Submitted by ehu on Wed, 11/14/2012 - 12:58


psql [database name]then
 \i /usr/share/ledgersmb/sql/upgrade/1.3-1.2.sqlor
psql [dbname] < /usr/share/ledgersmb/sql/upgrade/1.3-1.2.sql

Select all parts in orders

Member for

4 years 5 months
Submitted by ehu on Fri, 11/09/2012 - 13:25

All parts in order, from '2012-04-21' and '2012-04-22':

select p.partnumber, count(*), sum(qty) from orderitems o join parts p on p.id = o.parts_id where trans_id in (select id from oe where not closed and transdate between '2012-04-21' and '2012-04-22') group by p.partnumber;