Re: Like Query help

2021-01-14 Thread Bret Stern
Works. Thanks for the help. I will read the docs Best On 1/14/2021 4:37 PM, aNullValue (Drew Stemen) wrote: At 2021-01-14T19:27:23-05:00, Bret Stern sent: query select company_code, item_code, item_description, product_line, udf_item_width, udf_item_length, sales_unit_measure, ''as mat_type

Re: Like Query help

2021-01-14 Thread aNullValue (Drew Stemen)
At 2021-01-14T19:27:23-05:00, Bret Stern sent: > query > > select company_code, item_code, item_description, product_line, > udf_item_width, udf_item_length, sales_unit_measure, ''as mat_type from > mas_combined_item_master where company_code='BUR' or company_code='SNJ' > or company_code='EBC

Like Query help

2021-01-14 Thread Bret Stern
query select company_code, item_code, item_description, product_line, udf_item_width, udf_item_length, sales_unit_measure, ''as mat_type from mas_combined_item_master where company_code='BUR' or company_code='SNJ' or company_code='EBC' and udf_edb_managed='' and item_code LIKE 'S-%' order by

Re: Query help

2019-01-27 Thread Chuck Martin
On Sun, Jan 27, 2019 at 5:27 PM Chuck Martin wrote: > On Sun, Jan 27, 2019 at 8:07 AM Peter J. Holzer wrote: > >> On 2019-01-26 18:04:23 -0500, Chuck Martin wrote: >> [snip] >> > The idea should be obvious, but to explain, insdatetime is set when a >> new >> > record is created in any table. All

Re: Query help

2019-01-27 Thread Chuck Martin
On Sun, Jan 27, 2019 at 8:07 AM Peter J. Holzer wrote: > On 2019-01-26 18:04:23 -0500, Chuck Martin wrote: > [snip] > > The idea should be obvious, but to explain, insdatetime is set when a new > > record is created in any table. All records in ombcase have a foreign > key to > > status that can'

Re: Query help

2019-01-27 Thread Adrian Klaver
On 1/27/19 1:50 PM, Chuck Martin wrote: Chuck Martin Avondale Software On Sun, Jan 27, 2019 at 2:55 PM Adrian Klaver > wrote: On 1/26/19 3:04 PM, Chuck Martin wrote: [snip] Outline form: 1) If a record is in ombcase it has a status('in a sta

Re: Query help

2019-01-27 Thread Chuck Martin
Chuck Martin Avondale Software On Sun, Jan 27, 2019 at 2:55 PM Adrian Klaver wrote: > On 1/26/19 3:04 PM, Chuck Martin wrote: > [snip] > Outline form: > > 1) If a record is in ombcase it has a status('in a status') by definition. > > From query below you are not looking for just records in omb

Re: Query help

2019-01-27 Thread Adrian Klaver
On 1/26/19 3:04 PM, Chuck Martin wrote: I'm having trouble formulating a query. This is a simplified version of the tables: ombcase case_pkey integer, primary key casename varchar insdatetime timestamp w/o time zone status_fkey integer, foreign key status status_pkey inte

Re: Query help

2019-01-27 Thread Peter J. Holzer
On 2019-01-26 18:04:23 -0500, Chuck Martin wrote: > I'm having trouble formulating a query. This is a simplified version of the > tables: > > ombcase > > case_pkey integer, primary key > casename varchar > insdatetime timestamp w/o time zone > status_fkey integer, foreign key > > sta

Re: Query help

2019-01-26 Thread Charles Martin
On Sat, Jan 26, 2019 at 6:30 PM Ron wrote: > On 1/26/19 5:04 PM, Chuck Martin wrote: > > I'm having trouble formulating a query. This is a simplified version of > the tables: > > ombcase > > case_pkey integer, primary key > casename varchar > insdatetime timestamp w/o time zone > sta

Re: Query help

2019-01-26 Thread Ron
On 1/26/19 5:04 PM, Chuck Martin wrote: I'm having trouble formulating a query. This is a simplified version of the tables: ombcase case_pkey integer, primary key casename varchar insdatetime timestamp w/o time zone status_fkey integer, foreign key status status_pkey inte

Query help

2019-01-26 Thread Chuck Martin
I'm having trouble formulating a query. This is a simplified version of the tables: ombcase case_pkey integer, primary key casename varchar insdatetime timestamp w/o time zone status_fkey integer, foreign key status status_pkey integer, primary key statusid varchar statusch

Re: Query help

2019-01-01 Thread Adrian Klaver
On 1/1/19 12:05 PM, David G. Johnston wrote: On Tuesday, January 1, 2019, Adrian Klaver > wrote: On 1/1/19 11:26 AM, John W Higgins wrote: with accounts_over_total as ( select accountid from transactions where sum(amount) >= 50 group

Re: Query help

2019-01-01 Thread David G. Johnston
On Tuesday, January 1, 2019, Adrian Klaver wrote: > On 1/1/19 11:26 AM, John W Higgins wrote: >> >> with accounts_over_total as ( >> select accountid from transactions where sum(amount) >= 50 group by >> accountid) >> > > Unfortunately there is a hitch in the above:( > > select p_item_no from pro

Re: Query help

2019-01-01 Thread Adrian Klaver
On 1/1/19 11:26 AM, John W Higgins wrote: On Tue, Jan 1, 2019 at 11:06 AM Chuck Martin > wrote: Sorry if this is too basic a question for this list, but I don't fully get how to use aggregates (sum()) and group-by together. I'm trying to get a list o

Re: Query help

2019-01-01 Thread Adrian Klaver
On 1/1/19 11:05 AM, Chuck Martin wrote: Sorry if this is too basic a question for this list, but I don't fully get how to use aggregates (sum()) and group-by together. I'm trying to get a list of transactions where the total for a given account exceeds a given number. I'm not sure an example is

Re: Query help

2019-01-01 Thread David G. Johnston
On Tuesday, January 1, 2019, David G. Johnston wrote: > On Tuesday, January 1, 2019, Chuck Martin > wrote: > >> results wanted-all transactions where account total >= 50 >> >> id. amount. accountid.name >> 1. 50. 1 bill >> 3. 75.

Query help

2019-01-01 Thread David G. Johnston
On Tuesday, January 1, 2019, Chuck Martin wrote: > results wanted-all transactions where account total >= 50 > > id. amount. accountid.name > 1. 50. 1 bill > 3. 75. 1 bill > 4 25.

Re: Query help

2019-01-01 Thread John W Higgins
On Tue, Jan 1, 2019 at 11:06 AM Chuck Martin wrote: > Sorry if this is too basic a question for this list, but I don't fully get > how to use aggregates (sum()) and group-by together. I'm trying to get a > list of transactions where the total for a given account exceeds a given > number. I'm not

RE: Query help

2019-01-01 Thread Scot Kreienkamp
tin [mailto:clmar...@theombudsman.com] Sent: Tuesday, January 01, 2019 2:06 PM To: pgsql-general Subject: Query help Sorry if this is too basic a question for this list, but I don't fully get how to use aggregates (sum()) and group-by together. I'm trying to get a list of transactions where th

Query help

2019-01-01 Thread Chuck Martin
Sorry if this is too basic a question for this list, but I don't fully get how to use aggregates (sum()) and group-by together. I'm trying to get a list of transactions where the total for a given account exceeds a given number. I'm not sure an example is needed, but if so, consider this simplified