Linked Questions

2 votes
3 answers
72k views

How to check if value already exists in MySQL database [duplicate]

Possible Duplicate: How do I update if exists, insert if not (aka upsert or merge) in MySQL? I know this is pretty basic.. but for some reason this is not working for me. I have a form that ...
Dustin's user avatar
  • 4,369
3 votes
2 answers
15k views

If exists update else insert in one query [duplicate]

I have simple table like this: +----------+---------------+-------------+ | ID (int) | KEY (varchar) | VALUE (int) | +----------+---------------+-------------+ | 1 | asdf | ...
Michal's user avatar
  • 3,612
2 votes
2 answers
12k views

INSERT if not Exist Mysql [duplicate]

I have this table id follow_id follower_id 1 | 2 | 3 2 | 2 | 4 3 | 2 | 5 4 | 2 | 6 5 | 3 | 7 6 | 3 ...
Barno's user avatar
  • 3,321
6 votes
1 answer
8k views

Update if exist, insert if not exist [duplicate]

Possible Duplicate: How do I update if exists, insert if not (aka upsert or merge) in MySQL? I have program that can do batch updating price for booking engine. example user input for to do ...
GusDeCooL's user avatar
  • 5,712
1 vote
3 answers
16k views

insert into mysql database, if records already exists, then update [duplicate]

Possible Duplicate: How do I update if exists, insert if not (aka upsert or merge) in MySQL? how to insert into mysql database, if records already exists, then update...I know there is a solution ...
MFarooqi's user avatar
  • 1,024
1 vote
2 answers
8k views

INSERT INTO only if not exists MYSQL [duplicate]

I'm currently insert data by the way of using SELECT and not VALUES as it is by default. The problem is that I can't find a way to insert data only if it's not in the database. This is my current ...
Simon's user avatar
  • 1,201
0 votes
2 answers
728 views

update if exists [duplicate]

Possible Duplicate: How do I update if exists, insert if not (aka upsert or merge) in MySQL? I have a table with the columns user, category and score. I want to run an insert that, if this user/...
Fred's user avatar
  • 493
0 votes
1 answer
863 views

Update data if not exists, otherwise add to table [duplicate]

Possible Duplicate: How do I update if exists, insert if not (aka upsert or merge) in MySQL? I am creating a simple crawler gathering statistics from website. What I want to do is that if there ...
Blackie123's user avatar
  • 1,291
1 vote
1 answer
1k views

Insert or Update MySQL database if 3 fields match [duplicate]

I have the following schema CREATE TABLE `list` ( `name` text NOT NULL, `value` text NOT NULL, `id` int(11) NOT NULL, `note` text, ) ENGINE=MyISAM DEFAULT CHARSET=latin1; and I would like ...
Jani's user avatar
  • 537
2 votes
2 answers
624 views

SQL - IF EXISTS UPDATE ELSE INSERT [duplicate]

I have the following query: INSERT INTO distance (deviceID,datum,tavolsag) SELECT deviceID, DATE(FROM_UNIXTIME(timestamp)) as datum, sum(case when distanceKM/1000<416 then distanceKM/1000 else ...
Peter's user avatar
  • 23
0 votes
0 answers
597 views

How to find if a key already exists in my MySQL database? [duplicate]

I have codes that players can redeem for in-game goods like currency. These codes are one time codes, once they are used they are inserted into the players MySQL row on my table. How can I check if a ...
JavaC3code's user avatar
0 votes
0 answers
48 views

trying to use mysql update on insert [duplicate]

I have a data loading from an excel file where i am adding all the checks to check for the uploaded file and insert data accordingly, till this point everything seems to be working good. Now i am ...
Neil's user avatar
  • 23
1 vote
0 answers
39 views

Determining if a value exists in MySQL column... Through Python [duplicate]

All right, this is a weird one. I know there are ways in PHP to do this, but this is via a connector that is connecting from an ancient database called "PICK" to MySQL. Essentially, I need to ...
Kitfoxpup's user avatar
  • 267
0 votes
0 answers
23 views

Unknown system variable 'ROWCOUNT' [duplicate]

I need to insert the records that aren't existing in the table companies. I'm using the @@ROWCOUNT method to check if it exists. UPDATE companies SET `name`='<string>' WHERE `name`='<string&...
MrLine's user avatar
  • 668
627 votes
19 answers
391k views

UPSERT *not* INSERT or REPLACE

http://en.wikipedia.org/wiki/Upsert Insert Update stored proc on SQL Server Is there some clever way to do this in SQLite that I have not thought of? Basically I want to update three out of four ...
Mike Trader's user avatar
  • 8,684

15 30 50 per page