Re: [GENERAL] Query help

2016-10-04 Thread Daniel Caldeweyher
Try this: select distinct vendor_no, vendor_name from ap_vendors where vendor_no in ( select vendor_no from ap_vendors group by vendor_no having array_agg(company_code) @> ARRAY['BUR','EBC','SNJ']) On Wed, Oct 5, 2016 at 1:31 PM, Bret Stern wrote: >

Re: [GENERAL] Query help

2016-10-04 Thread Rob Sargent
> On Oct 4, 2016, at 9:31 PM, Bret Stern > wrote: > > Good evening, > I'm curious about a way to ask the following question of my vendors > table. > > psuedo1 "select all vendors which exist in BUR and EBC and SNJ" > > and > psuedo2 "select all vendors which

[GENERAL] Query help

2016-10-04 Thread Bret Stern
Good evening, I'm curious about a way to ask the following question of my vendors table. psuedo1 "select all vendors which exist in BUR and EBC and SNJ" and psuedo2 "select all vendors which DO NOT exist in all three show rooms The data is from a Sage accounting system which I pull out and

[GENERAL] Query help

2008-08-14 Thread novice
Hi, I have a table select id, config_id, start_day, end_day, start_time, end_time from config; id | config_id | start_day | end_day | start_time | end_time -+---+---+-++-- 1 | 101 | Mon | Sun | 08:30:00 | 18:00:00 2 |

Re: [GENERAL] Query help

2008-08-14 Thread Hui Xie
novice [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 15/08/2008 08:32 AM To pgsql-general@postgresql.org cc Subject [GENERAL] Query help Hi, I have a table select id, config_id, start_day, end_day, start_time, end_time from config; id | config_id | start_day | end_day | start_time

Re: [GENERAL] Query help

2008-08-14 Thread novice
2008/8/15 novice [EMAIL PROTECTED]: Hi, I have a table select id, config_id, start_day, end_day, start_time, end_time from config; id | config_id | start_day | end_day | start_time | end_time -+---+---+-++-- 1 | 101 | Mon |

Re: [GENERAL] Query help

2008-08-14 Thread Brent Wood
If I read this correctly, you want the output sorted by config_id,start_day(day),start_time, thus: select config_id, start_day as day, start_time, end_time from config order by config_id, start_day, start_time; Cheers, Brent Wood novice [EMAIL PROTECTED] 08/15/08 3:55 PM Hi, I have a

[GENERAL] query help

2007-09-13 Thread volunteer
hello table is +---+---+--+---+ | id | one | two | three | +---+---+--+---+ | first | Jack | Jill | Mary | | last | Ja | Ji | Ma | +---+---+--+---+ result is ++---+---+ | id | one | two | ++---+---+ | first

Re: [GENERAL] query help

2007-09-13 Thread Alexander Staubo
On 9/13/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hello table is +---+---+--+---+ | id | one | two | three | +---+---+--+---+ | first | Jack | Jill | Mary | | last | Ja | Ji | Ma | +---+---+--+---+ result is

Re: [GENERAL] query help

2007-09-13 Thread Rodrigo De León
On 9/13/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: query is?? http://www.w3schools.com/sql/default.asp ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL

Re: [GENERAL] query help

2007-09-13 Thread volunteer
hello i add more column not row for new user. i want all last like 'J%'. http://www.nabble.com/an-other-provokative-question---tf4394285.html sincerely siva Original Message Subject: Re: [GENERAL] query help From: Alexander Staubo [EMAIL PROTECTED] Date: Thu, September 13, 2007

Re: [GENERAL] query help

2007-09-13 Thread Alexander Staubo
On 9/13/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: i add more column not row for new user. i want all last like 'J%'. http://www.nabble.com/an-other-provokative-question---tf4394285.html Sorry, but the only difference between your table example and your result example was the absence, in

Re: [GENERAL] query help

2007-09-13 Thread Steve Crawford
[EMAIL PROTECTED] wrote: hello i add more column not row for new user. i want all last like 'J%'. http://www.nabble.com/an-other-provokative-question---tf4394285.html sincerely siva You add a new _column_ for each user?!? That is hideously broken in so many ways. It makes the trivially easy

Re: [GENERAL] query help

2007-09-13 Thread volunteer
many apologees. right link http://archives.postgresql.org/pgsql-general/2007-09/msg00607.php i flip row to column if ok. but howto query?? sincerely siva Original Message Subject: Re: [GENERAL] query help From: Alexander Staubo [EMAIL PROTECTED] Date: Thu, September 13, 2007 11

Re: [GENERAL] query help

2007-09-13 Thread brian
[EMAIL PROTECTED] wrote: hello i add more column not row for new user. i want all last like 'J%'. I get the feeling that the result as you've laid it out is not what we all think it is. For example: table is +---+---+--+---+ | id | one | two | three |

Re: [GENERAL] query help

2007-09-13 Thread volunteer
can u refer to row?? howto select * from table where row(#2) like 'J%'?? i wanted to test column storing but not ok as no row refer name/id. many thank yous sincerely siva Original Message Subject: Re: [GENERAL] query help From: [EMAIL PROTECTED] Date: Thu, September 13, 2007 11

[GENERAL] query help

2007-08-14 Thread Kirk Wythers
I need some help with rewriting a query. I have a fairly complicated query (for me anyway) that dumps daily climate data, filling in missing data with monthly averages (one line per day). I want to output monthly averages (one line per month). I am having a hard time wrapping my head

Re: [GENERAL] query help

2007-08-14 Thread Josh Tolley
On 8/14/07, Kirk Wythers [EMAIL PROTECTED] wrote: I need some help with rewriting a query. I have a fairly complicated query (for me anyway) that dumps daily climate data, filling in missing data with monthly averages (one line per day). I want to output monthly averages (one line per

Re: [GENERAL] Query help

2007-03-08 Thread Richard Huxton
Madison Kelly wrote: Hi all, I've got a query that looks through a table I use for my little search engine. It's something of a reverse-index but not quite, where a proper reverse index would have 'word | doc1, doc3, doc4, doc7' showing all the docs the keyword is in, mine has an entry for

Re: [GENERAL] Query help

2007-03-08 Thread Madison Kelly
Richard Huxton wrote: Madison Kelly wrote: Hi all, I've got a query that looks through a table I use for my little search engine. It's something of a reverse-index but not quite, where a proper reverse index would have 'word | doc1, doc3, doc4, doc7' showing all the docs the keyword is

[GENERAL] Query help

2007-03-07 Thread Madison Kelly
Hi all, I've got a query that looks through a table I use for my little search engine. It's something of a reverse-index but not quite, where a proper reverse index would have 'word | doc1, doc3, doc4, doc7' showing all the docs the keyword is in, mine has an entry for eac I've got a

Re: [GENERAL] Query help

2007-03-07 Thread Shaun Johnston
Try SELECT DISTINCT rather than SELECT That should return a result with unique records. Madison Kelly wrote: Hi all, I've got a query that looks through a table I use for my little search engine. It's something of a reverse-index but not quite, where a proper reverse index would have

Re: [GENERAL] Query Help

2007-01-21 Thread Howard Cole
Tom Lane wrote: It looks like you have a stale plan for that ON DELETE SET NULL constraint. Was there perhaps an index on operator_id that you removed? Postgres is not very good about flushing cached plans when you change table schemas (something I hope will be fixed in 8.3). If that is the

[GENERAL] Query Help

2007-01-19 Thread Howard Cole
Hi All, I am getting an error I do not understand from the following setup CREATE TABLE timesheet_booking ( timesheet_booking_id bigserial NOT NULL, operator_id integer, booking_item_id integer, day date NOT NULL, minutes integer NOT NULL, CONSTRAINT timesheet_booking_pkey PRIMARY KEY

Re: [GENERAL] Query Help

2007-01-19 Thread Tom Lane
Howard Cole [EMAIL PROTECTED] writes: If I try the following query: delete from operator where operator_id=283; I get the following error message: ERROR: could not open relation with OID 438427 SQL state: XX000 Context: SQL statement UPDATE ONLY public.timesheet_booking SET

Re: [GENERAL] query help

2001-09-14 Thread Ian Barwick
Jeff Patterson wrote: This seems like such a basic function that I'm sure I am missing something fundamental. I have a table, say xref, whose columns are primary key values for other tables. Some of theses keys may be NULL for a given row in xref. I want to create a query that returns the

[GENERAL] query help

2001-09-07 Thread Jeff Patterson
This seems like such a basic function that I'm sure I am missing something fundamental. I have a table, say xref, whose columns are primary key values for other tables. Some of theses keys may be NULL for a given row in xref. I want to create a query that returns the corresponding entries in the

Re: [GENERAL] query help

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Jeff Patterson wrote: This seems like such a basic function that I'm sure I am missing something fundamental. I have a table, say xref, whose columns are primary key values for other tables. Some of theses keys may be NULL for a given row in xref. I want to create a query

Re: [GENERAL] query help

2001-08-31 Thread wsheldah
PROTECTED] on 08/30/2001 07:45:20 PM To: [EMAIL PROTECTED] cc:(bcc: Wesley Sheldahl/Lex/Lexmark) Subject: [GENERAL] query help Hi all, How would I get TableB.label if all I know about is TableA.name? I was thinking about a query on TableA first, then within the while (rs.next()), I'd do