Hi;
I would like to test the following:
update maps set map where site=mysite;
to see if there is such an entry in maps. If there is, then update. If there
is not, then I would like to execute an insert statement. How do I do that?
TIA,
Victor
from: http://dev.mysql.com/doc/refman/5.1/en/insert.html:
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
[INTO] tbl_name
SET col_name={expr | DEFAULT}, ...
[ ON DUPLICATE KEY UPDATE
col_name=expr
[, col_name=expr] ... ]
The ON DUPLICATE KEY predicate tells
Hi Vicor,
Look into INSERT ON DUPLICATE or REPLACE statements. You need to
have a primary key or unique key for these too work.
On Sun, Jul 26, 2009 at 1:11 PM, Victor Subervivictorsube...@gmail.com wrote:
Hi;
I would like to test the following:
update maps set map where site=mysite;
to
Perfect. Thank you.
Victor
On Sun, Jul 26, 2009 at 2:18 PM, Darryle Steplight dstepli...@gmail.comwrote:
Hi Vicor,
Look into INSERT ON DUPLICATE or REPLACE statements. You need to
have a primary key or unique key for these too work.
On Sun, Jul 26, 2009 at 1:11 PM, Victor
Hi
I need to update the 'products_id' field (shown below) by copying data from
a separate table but I can't use the 'UPDATE' query as each 'product_id'
entry relates to a specific 'products_model' row.
id / assembly_no / products_id / products_model
1 / 2313 / *** / CASEACERENTRY2
2 / 2313 /
Hello.
Please, could you provide the CREATE statement for you tables
and describe the relationships between their fields (it will
be good if you include sample data as well).
Matthew Batt wrote:
Hi
I need to update the 'products_id' field (shown below) by copying data
from a
This statement works if I enter it directly into mysql:
UPDATE BEX_USER_REG_INFO SET STATUS_ID=5 WHERE
BEX_USER_REG_INFO.BEX_USER_REG_INFO_ID=2
Utilizing the openquery command I'm trying to do the same thing from a
MS SQL Server
SELECT * FROM OPENQUERY(MYSQLTEST, 'UPDATE BEX_USER_REG_INFO
Anyone have a response to the following:
Hi
I have a db that gets data dumped into it. One of the columns gets unix
timestamp data utime.
I what to covert that into a datetime column so I can utlize indexes and
such.
But I still what the unixtime to remain.
I know I can get the data I want with
) from t_test;
-Original Message-
From: Ron McKeever [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 10:58 AM
To: [EMAIL PROTECTED]
Subject: unixtime update syntax
Anyone have a response to the following:
Hi
I have a db that gets data dumped into it. One
sec)
Any ideas?
Ron
-Original Message-
From: Dan Greene [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 8:30 AM
To: Ron McKeever; [EMAIL PROTECTED]
Subject: RE: unixtime update syntax
The time zone matters... your results are exactly 8 hours off... PST is
gmt -8. So it looks
On 2 Dec 2003 at 7:57, Ron McKeever wrote:
I have a db that gets data dumped into it. One of the columns gets
unix timestamp data utime. I what to covert that into a datetime
column so I can utlize indexes and such. But I still what the unixtime
to remain.
You can use indexes with a Unix
Message-
From: Keith C. Ivey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 8:55 AM
To: [EMAIL PROTECTED]
Subject: Re: unixtime update syntax
On 2 Dec 2003 at 7:57, Ron McKeever wrote:
I have a db that gets data dumped into it. One of the columns gets
unix timestamp data utime. I
On 2 Dec 2003 at 9:12, Ron McKeever wrote:
Thats seems like a bug to me.
I would think FROM_UNIXTIME would take a unixtime stamp
and covert it to what it is. We know its from GMT
A Unix timestamp represents a particular second in time. It doesn't
have a time zone associated with it. Yes,
, December 02, 2003 8:55 AM
To: [EMAIL PROTECTED]
Subject: Re: unixtime update syntax
On 2 Dec 2003 at 7:57, Ron McKeever wrote:
I have a db that gets data dumped into it. One of the columns gets
unix timestamp data utime. I what to covert that into a datetime
column so I can utlize indexes
Hi
I have a db that gets data dumped into it. One of the columns gets unix
timestamp data utime.
I what to covert that into a datetime column so I can utlize indexes and
such.
But I still what the unixtime to remain.
I know I can get the data I want with php or mysql to convert it, but I need
PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 04:55
Subject: Re: Update Syntax
Can you use REPLACE?
Kelley
Randy Chrismon wrote:
Please tell me it ain't so...
I am writing a Lotus Nots agent to feed data directly into a MySQL
table. The agent needs to either insert
Please tell me it ain't so...
I am writing a Lotus Nots agent to feed data directly into a MySQL
table. The agent needs to either insert a new record or update an
existing record depending on whether a document in Nots is new or
updated. Because this app may be ported over to a DB2 server, I am
Can you use REPLACE?
Kelley
Randy Chrismon wrote:
Please tell me it ain't so...
I am writing a Lotus Nots agent to feed data directly into a MySQL
table. The agent needs to either insert a new record or update an
existing record depending on whether a document in Nots is new or
updated.
-Original Message-
From: MySQL [mailto:[EMAIL PROTECTED]
Sent: 12 March 2003 22:33
To: MySQL
Subject: UPDATE syntax help
Hi all, I am having a little UPDATE syntax issue. According
to the manual
UPDATE EBA_USERS, IMPORT_USERS
SET EBA_USERS.HUB_ID = IMPORT_USERS.HUB_ID
Hi
I may be way off base here but - why do you reference IMPORT_USERS in your
UPDATE statement? You aren't updating any columns in that table.
Regards,
Sal
-Original Message-
From: MySQL [mailto:[EMAIL PROTECTED]
Sent: 12 March 2003 22:33
To: MySQL
Subject: UPDATE syntax help
Hi all, I am having a little UPDATE syntax issue. According to the manual
UPDATE EBA_USERS, IMPORT_USERS
SET EBA_USERS.HUB_ID = IMPORT_USERS.HUB_ID,
EBA_USERS.REP_LOCATION_ID = IMPORT_USERS.REP_LOCATION_ID,
EBA_USERS.REP_FIRST_NAME = IMPORT_USERS.REP_FIRST_NAME,
EBA_USERS.REP_LAST_NAME
At 8:33 +1000 3/13/03, MySQL wrote:
Hi all, I am having a little UPDATE syntax issue. According to the manual
According to the manual, this won't work until MySQL 4.x
UPDATE EBA_USERS, IMPORT_USERS
SET EBA_USERS.HUB_ID = IMPORT_USERS.HUB_ID,
EBA_USERS.REP_LOCATION_ID
That explains it then D'OH
Is there a workaround?
Thanks :-)
- Original Message -
From: Paul DuBois [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]; MySQL [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 9:02 AM
Subject: Re: UPDATE syntax help
At 8:33 +1000 3/13/03, MySQL wrote:
Hi
]
To: MySQL [EMAIL PROTECTED]; MySQL [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 9:02 AM
Subject: Re: UPDATE syntax help
At 8:33 +1000 3/13/03, MySQL wrote:
Hi all, I am having a little UPDATE syntax issue. According to the
manual
According to the manual, this won't work until MySQL 4.x
with your code (or
directly from SQL if you're a martyr) and then run it.
I've used both methods successfully,
Andy
-Original Message-
From: JJ [mailto:[EMAIL PROTECTED]
Sent: 12 March 2003 23:45
To: MySQL
Cc: Paul DuBois
Subject: Re: UPDATE syntax help
That explains
Eastham [EMAIL PROTECTED]
To: [EMAIL PROTECTED] Mysql. Com [EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 10:14 AM
Subject: RE: UPDATE syntax help
Paul,
You have to use the results of one select to generate lots of update
statements. If you execute all these from your program, make sure you
I was reading somewhere that MySQL 4.1 UPDATE syntax will allow update to
table with values from another table in the following manner:
update client, zip
set client.st = zip.st, client.city = zip.city
where client.zip = zip.zip;
Is there a creative way to do this in 4.0.11?
chas
At 21:41 -0600 3/9/03, Charles Lewis wrote:
I was reading somewhere that MySQL 4.1 UPDATE syntax will allow
update to table with values from another table in the following
manner:
update client, zip
set client.st = zip.st, client.city = zip.city
where client.zip = zip.zip;
Is there a creative
Hi All,
With a database that contains tables PetInv and Purchases:
mysql update PetInv
- set PetInv.Qty = PetInv.Qty + Purchases.Qty
- where PetInv.ItemNo = Purchases.ItemNo;
ERROR 1109: Unknown table 'Purchases' in where clause
As you can see I'm trying to add purchase quantities
PROTECTED]'
Subject: Update syntax
Hi All,
With a database that contains tables PetInv and Purchases:
mysql update PetInv
- set PetInv.Qty = PetInv.Qty + Purchases.Qty
- where PetInv.ItemNo = Purchases.ItemNo;
ERROR 1109: Unknown table 'Purchases' in where clause
As you can see I'm
Howdy,
I'm trying to perform an update on a php poll table.
Here is the table description:
mysql describe vbooth_data;
+-+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+-+--+--+-+-+---+
|
Hi,
You should escape quotes within strings:
Matthias Trevarthan wrote:
Howdy,
I'm trying to perform an update on a php poll table.
Here is the table description:
mysql describe vbooth_data;
+-+--+--+-+-+---+
| Field | Type | Null |
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 9:31 AM
To: [EMAIL PROTECTED]
Subject: UPDATE syntax dummy question...
Howdy,
I'm trying to perform an update on a php poll table.
Here is the table description:
mysql describe vbooth_data
You need to escape the ' mark in your string. The query should be:
update vbooth_data set optionText='Not at all, I''m waiting for the
other shoe to drop' where (pollID=34 AND voteID=3);
Note the '' within the string: the first tick escapes the second one.
If you're more comfortable with
Howdy Matthias,
update vbooth_data set optionText='Not at all, I'm waiting for the other
shoe
to drop' where (pollID='34' AND voteID='3');
When I hit Enter, it gives me this prompt:
'
Two things:
1 (the ) is because it is waiting for the end of the string - you have an
apostrophe opening
Thanks everyone!
I see that I need double quotes now.
I received about 12 different personal emails from various people with exactly
the same answer. Thanks again!
On Tuesday 03 September 2002 10:31, Matthias Trevarthan wrote:
Howdy,
I'm trying to perform an update on a php poll table.
On Tue, 2002-09-03 at 16:31, Matthias Trevarthan wrote:
And here is my update query:
update vbooth_data set optionText='Not at all, I'm waiting for the other shoe
to drop' where (pollID='34' AND voteID='3');
When I hit Enter, it gives me this prompt:
'
This prompt indicates you did
-
Van: Egor Egorov [mailto:[EMAIL PROTECTED]]
Verzonden: donderdag 20 juni 2002 15:53
Aan: [EMAIL PROTECTED]
Onderwerp: Re: update syntax
RBRoa,
Thursday, June 20, 2002, 8:07:54 AM, you wrote:
R Is it possible to include another table in [where clause] using the
update
R syntax in MySQL?..
R e.g
Hello Terry,
Thursday, June 20, 2002, 5:14:40 PM, you wrote:
DT Egor,
DT I hope I understand you work for MySQL in some fashion, is there any plan to
DT allow sub-selects in future releases ?
Yes, multi-table updates and sub-selects is on development and they
will come in version 4.1
DT RSVP,
Vadim,
Friday, February 01, 2002, 5:00:33 AM, you wrote:
VK Greetings:
VK I'm trying to update a table T1 based on the condition which is a result
VK of the key join table A and table B
VK the following command works with SYBASE but doesn't with MySQL:
VK update A,B set A.field2='test'
: Thursday, January 31, 2002 10:00 PM
Subject: Update syntax
Greetings:
I'm trying to update a table T1 based on the condition which is a result
of the key join table A and table B
the following command works with SYBASE but doesn't with MySQL:
update A,B set A.field2='test' where A.field1
Don wrote:
Hi,
I'm looking at the docs for the UPDATE syntax right now!
Here is my code (in Perl):
$sqlCmd = $dbh-prepare("UPDATE Ports SET Country = $country,
TransPort = $transPort,
Susp
On Mon, 22 Jan 2001, Don wrote:
Hi,
I'm looking at the docs for the UPDATE syntax right now!
Here is my code (in Perl):
$sqlCmd = $dbh-prepare("UPDATE Ports SET Country = $country,
TransPort = $tran
43 matches
Mail list logo