Re: [SQL] query problem

2002-08-30 Thread Jean-Luc Lachance
I think you meant min(date)... Josh Berkus wrote: > > Marco, > > > Is there a way to obtain this records by performing one > > single query and not by making for each city something like > > "SELECT city,date FROM table WHERE city='London' AND date>'2002-07-19 > > 15:39:15+00' ORDER BY date AS

Re: [SQL] query problem

2002-08-30 Thread Jean-Luc Lachance
How about: select city, min(date) from thetable where date > '2002-07-19 15:39:15+00' group by city; JLL Marco Muratori wrote: > > Hi > suppose I have the following situation: > > citydate > -+--- > London | 2002-08-08 07:05:16+00 > London | 2002

[SQL] Large number of lookups

2002-08-30 Thread Jeff Boes
I have a large table (>2 Mrows) against which my application runs some 1M queries per day. The queries are almost all of the nature of select PRIMARY_KEY_FLD from MY_TABLE where SECONDARY_KEY_FLD = 'something'; I've optimized the table to the limits of what I can think of, now I'm looking to

Re: [SQL] query problem

2002-08-30 Thread Josh Berkus
Marco, > Is there a way to obtain this records by performing one > single query and not by making for each city something like > "SELECT city,date FROM table WHERE city='London' AND date>'2002-07-19 > 15:39:15+00' ORDER BY date ASC LIMIT 1;"? Close. Try: SELECT city, MAX("date") as last_date F

[SQL] query problem

2002-08-30 Thread Marco Muratori
Hi suppose I have the following situation: citydate -+--- London | 2002-08-08 07:05:16+00 London | 2002-07-30 13:08:22+00 London | 2002-07-30 07:39:15+00 London | 2002-07-29 17:51:47+00 London | 2002-07-29 17:45:49+00 London | 2002-07-29 17:45

Re: [SQL] How to Select with more than one AND in a Where SQL Clause?

2002-08-30 Thread Josh Berkus
Zenith, > Qry = "Select * from Table Where A1 Like '%' AND A2 Like '%' AND A3 Like '%' > AND A4 Like '%' AND A5 Like '%'" > > But in spite of I need a SQL sentence with four (04) AND's in its Where > clause, my SQL compiler only allow me using one AND. > > So How can I solve such a problem.

Re: [SQL] Why must the function that a trigger calls return "opaque" ???

2002-08-30 Thread Josh Berkus
Greg, > This seem rather limiting... Suppose I want a trigger that after insert, > returns the currval(sequence) of the newly inserted row automatically > without having to run another query ??? Because you can't capture the return value of a trigger. The trigger is returning the new/altered/

Re: [SQL] RFC822 Checker

2002-08-30 Thread Bruno Wolff III
On Fri, Aug 30, 2002 at 14:07:28 +, Matthew Price <[EMAIL PROTECTED]> wrote: > Howdy, > > Does anyone know of an SQL function that will check a string for compliance with the >RFC822 mail address spec? I have a script that sends mail from a db (no, I am not a >spammer) but I often have m

[SQL] RFC822 Checker

2002-08-30 Thread Matthew Price
Howdy, Does anyone know of an SQL function that will check a string for compliance with the RFC822 mail address spec? I have a script that sends mail from a db (no, I am not a spammer) but I often have mails sitting in my queue because the MTA (correctly) refuses to process some of the bogus

[SQL] Why must the function that a trigger calls return "opaque" ???

2002-08-30 Thread Greg Patnude
This seem rather limiting... Suppose I want a trigger that after insert, returns the currval(sequence) of the newly inserted row automatically without having to run another query ??? GP ---(end of broadcast)--- TIP 3: if posting/reading throug

[SQL] How to Select with more than one AND in a Where SQL Clause?

2002-08-30 Thread Zenith Vivas
Dear friends, I need a SQL sentence like this: Qry = "Select * from Table Where A1 Like '%' AND A2 Like '%' AND A3 Like '%' AND A4 Like '%' AND A5 Like '%'" But in spite of I need a SQL sentence with four (04) AND's in its Where clause, my SQL compiler only allow me using one AND. So How can