Re: [SQL] SQL confusion

2004-10-09 Thread Richard Poole
On Sat, Oct 09, 2004 at 01:39:45PM -0700, Andrew Ward wrote: > > I'm running postgres 7.3.2 on linux, and making my > requests from Perl scripts using DBD::Pg. My table > structure is as follows (irrelevant cols removed) > > CREATE TABLE name ( > namecounter integer NOT NULL, > firstmidd

Re: [SQL] Trigger and function not on speaking terms

2004-08-02 Thread Richard Poole
On Mon, Aug 02, 2004 at 04:20:15PM -0400, Jeff Boes wrote: > It would seem my trigger definition is trying to find fn_foo(), when I > mean for it to call fn_foo(TEXT). Triggers have to be declared to take no arguments; they find the rows on which they operate in magical ways. (For PL/PgSQL trigg

Re: [SQL] Scalar subqueries

2004-06-14 Thread Richard Poole
On Mon, Jun 14, 2004 at 12:38:44PM -0700, Subbiah, Stalin wrote: > > I've a logs table that has both sign-in and sign-out records which are > differentiated by action flag. Records with action flag = (1,2) => sign-in > records and action flag = (3,4,5,6,7) => sign-out records. > All I'm trying

Re: [SQL] max value from join

2004-06-14 Thread Richard Poole
On Mon, Jun 14, 2004 at 11:02:06AM -0500, hook wrote: > I have a court program with related tables > I am trying to extract data related to the last conttinue date using > select >c.citkey, /* c.cdate, >c.badge, c.vioDesc, >b.lname, b.fname,b.mi, b.race, b.dob, b.

Re: [SQL] Left joins with multiple tables

2004-01-18 Thread Richard Poole
On Sat, Jan 17, 2004 at 02:30:01AM +, Colin Fox wrote: > For each person in the people table, they may or may not have a record in > a, may or may not have a record in b, and may or may not have a record in > c. ... > But I'd like to be able to do something like: > > select > id, name,

Re: TODO item for plpgsql Was Re: [SQL] obtuse plpgsql function needs

2003-08-01 Thread Richard Poole
On Fri, Aug 01, 2003 at 01:06:18PM -0700, Josh Berkus wrote: > As far as I can tell from my PL/SQL guide to Oracle8, PL/SQL does not permit > exectution of strings-as-queries at all. So there's no equivalent in PL/SQL. I'm not an Oracle bunny but they seem to have something vaguely similar to w

Re: [SQL] One to many query question

2003-07-31 Thread Richard Poole
On Wed, Jul 30, 2003 at 02:35:20PM -0500, Dave Dribin wrote: > Hi, I'm having trouble with what I think should be an easy query. For > simplicity, I will use a CD database as an example. Each CD may have > multiple genres. Here's some sample data: > > Artist Title

Re: [SQL] unique value - trigger?

2003-07-19 Thread Richard Poole
On Thu, Jul 17, 2003 at 12:56:52PM +0100, Gary Stainburn wrote: > > nymr=# \d lnumbers >Table "lnumbers" > Column | Type | Modifiers > ---+---+--- > lnid | integer | not null > lnumber | character varyi

Re: [SQL] unique value - trigger?

2003-07-17 Thread Richard Poole
n Thu, Jul 17, 2003 at 12:56:52PM +0100, Gary Stainburn wrote: > > nymr=# \d lnumbers >Table "lnumbers" > Column | Type | Modifiers > ---+---+--- > lnid | integer | not null > lnumber | character varying

Re: [SQL] CHECK clause doesn't work with CASE clause

2002-06-27 Thread Richard Poole
On Thu, Jun 27, 2002 at 11:52:54AM +0200, J?rg Holetschek wrote: > Hi folks, > > I have a problem with a CHECK clause that doesn't seem to work properly. The > CASE > WHEN ((focus <> NULL) AND (epilepsy_class = 'f')) THEN > TRUE > WHEN

Re: [SQL] 2 tables, joins and same name...

2001-08-31 Thread Richard Poole
On Thu, Aug 30, 2001 at 04:25:41PM -0400, Marc André Paquin wrote: > Hello, > > Here is 2 tables: > > airport > - > airport_id > name > code > city_id > > destination > --- > destination_id > dest_name > ... > airport_dep_id // using airport.airport_id (departure) > airport_arr

Re: [SQL] primary key scans in sequence

2001-03-30 Thread Richard Poole
On Thu, Mar 29, 2001 at 03:47:58PM +0200, bernd wrote: > hey i have the following table def (834.000 rows, vaccum analyze'd): > dl_online=# \d mitglied > Table "mitglied" >Attribute| Type | Modifier > +--+--

Re: [SQL] Oracle to PostgreSQL help: What is (+) in Oracle select?

2001-03-16 Thread Richard Poole
On Fri, Mar 16, 2001 at 05:57:14PM -0500, Christopher Audley wrote: > I'm trying to modify an application which runs on Oracle to run against > PostgreSQL. I'm currently stuck on a query that I can't recognize, it > doesn't look like standard SQL. > > A select is done across two tables, howeve

Re: [SQL] Re: Use of the LIMIT clause ?

2001-03-13 Thread Richard Poole
On Mon, Mar 12, 2001 at 09:21:58PM -0500, Tom Lane wrote: > Spy <[EMAIL PROTECTED]> writes: > > Tom Lane a écrit : > >> Is that actually how MySQL interprets two parameters? We treat them > >> as count and offset respectively, which definition I thought was the > >> same as MySQL's. > > > But My