Re: If exists query.

2006-04-24 Thread Peter Brawley
Paul, >> > > I am doing queries that produce a table that looks something like this: >> > > >> > > Count   | IP Address    | First Seen    | Last Seen | Days >> > > 5000  10.0.0.1   2005-12-10    2006-04-15  50* >> > > 6500  10.0.0.2   2006-04-01    2006-04-06  

Re: If exists query.

2006-04-24 Thread Shawn Green
--- Paul Halliday <[EMAIL PROTECTED]> wrote: > On 4/23/06, John Hicks <[EMAIL PROTECTED]> wrote: > > Paul Halliday wrote: > > > > I am doing queries that produce a table that looks something like > this: > > > > > > Count | IP Address| First Seen| Last Seen | Days > > > 5000

Re: If exists query.

2006-04-24 Thread Paul Halliday
On 4/23/06, John Hicks <[EMAIL PROTECTED]> wrote: > Paul Halliday wrote: > > I am doing queries that produce a table that looks something like this: > > > > Count | IP Address| First Seen| Last Seen | Days > > 5000 10.0.0.1 2005-12-102006-04-15 50* > > 6500

Re: If exists query.

2006-04-23 Thread Paul Halliday
I am doing queries that produce a table that looks something like this: Count | IP Address| First Seen| Last Seen | Days 5000 10.0.0.1 2005-12-102006-04-15 50* 6500 10.0.0.2 2006-04-012006-04-06 3** *So of the 5000 events "count(*) bet

Re: If exists query.

2006-04-23 Thread John Hicks
Paul Halliday wrote: I am trying to formulate a query that will increment if a condition is true. For example, if I do a select (just let me know if there was data on this day, if so increment count by 1 and check the next day) where timestamp between jan and feb. Could you be a bit more speci

Re: if exists

2004-05-05 Thread Michael Stassen
I think this is half the answer (though you've implied the other half). First, you prevent mysql from accepting duplicate rows by defining a PRIMARY KEY or UNIQUE INDEX on whatever column or columns determine uniqueness. See for the details.

Re: if exists

2004-05-05 Thread Paul DuBois
At 12:12 +0200 5/5/04, Gerhard Gaupp wrote: Hello I'm looking for something like if not exists( select 1 from PERSON where NAME = 'Test' ) then insert into PERSON ( NAME ) values ( 'Test'); end if; I did it with Sybase Database. I need to get Data from Excel and have to be shure that there is

RE: if exists

2004-05-05 Thread emierzwa
Silently ignore duplicate index inserts... insert IGNORE into PERSON ( NAME ) values ( 'Test') Ed -Original Message- From: Gerhard Gaupp [mailto:[EMAIL PROTECTED] Hello I'm looking for something like if not exists( select 1 from PERSON where NAME = 'Test' ) then insert into PERSON (

Re: If Exists update else insert

2004-02-18 Thread Victoria Reznichenko
"Juan E Suris" <[EMAIL PROTECTED]> wrote: > I need to do something similar to replace, but can't figure out how to do it. > > Here's my table: > user varchar(15) PRI > cnt int(11) > > I want to increment cnt for user if it exists, else insert a row with cnt=1. I tried > the following, but mysql

Re: If exists UPDATE else INSERT

2001-01-26 Thread Artem Koutchine
I've seen something about this in the manual. At the moment the problem was how to call such an SQL command (like REPLACE for DELETE/INSERT). I wonder if it was implemented in 3.23.32 or is it only in 4.x? - Original Message - From: "Jan Willamowius" <[EMAIL PROTECTED]> To: <[EMAIL PROTEC