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
Nathan,
That was exactly what I was looking for, thanks for your help.
John
-Original Message-
From: Nathan Sullivan [mailto:nsulli...@cappex.com]
Sent: Monday, June 29, 2009 2:55 PM
To: John Furlong; mysql@lists.mysql.com
Subject: RE: Update email address domain
John,
I think this
John,
I think this should work:
UPDATE members SET email=REPLACE(email, SUBSTRING(email,INSTR(email,'@')+1),
'Thanks_in_advance.com.com')
Regards,
Nathan
-Original Message-
From: John Furlong [mailto:john.furl...@rakutenusa.com]
Sent: Monday, June 29, 200
I'm trying to mask the email addresses for a development database. I need to
make all of the domains exactly the same. What is the best way to do this? We
have about 67000 distinct domains.
I was able to use substring to get the list of domains, but am not sure how to
turn that into an u
I'm trying to resolve a frustrating replication problem with my databases.
The master contains a number of schema, only using Innodb tables.
Updates happen regularly, usually using bulk inserts of the form
INSERT ... ON DUPLICATE UPDATE. Data is mostly numbers. The missing
queries conta
On Fri, May 22, 2009 at 1:22 PM, Chris W <4rfv...@cox.net> wrote:
> Of course study to profile is a one to many relationship. How do I run an
> update to set p.`Date` equal to s.`Date`?
This is covered in the docs for UPDATE. Read that and come back if
you're stuck.
- Perrin
I have a table with a date value that I need to update with a value from
another table.
The table I want to update is profile. The profile table is linked to
the study table with the foreign key StudyID.
the profile table has the date I want to update to the value in the date
value in the
Can u tell me , assume if i use If in the query , then i reduce performance
,
Any idea
On Mon, May 18, 2009 at 3:19 PM, Janek Bogucki
wrote:
> Hi,
>
> mysql> create table t(i int);
>
> mysql> insert into t values(1),(2),(3);
>
> mysql> select i, if(i <= 1, 'low', 'high') from t order by i;
> +--
Hi,
mysql> create table t(i int);
mysql> insert into t values(1),(2),(3);
mysql> select i, if(i <= 1, 'low', 'high') from t order by i;
+--+---+
| i| if(i <= 1, 'low', 'high') |
+--+---+
|1 | low |
|2 | hig
Hi all ,
Can u give one example query ,
Which contain the IF condition ,
Because here before am not used the IF and all ,
Thanks
--
உங்கள் நண்பன்
பரணி குமார்
Regards
B.S.Bharanikumar
POST YOUR OPINION
http://bharanikumariyerphp.site88.net/bharanikumar/
| NULL
||
+-+--+--+-+---
++
where 'payload' size usually is quite big!
Now I want to manipulate a number of rows in a non-trivial way and at
the
same time set 'id' for those rows to a new number in the sequence. I.e.
UPDAT
2005-02-18
> 222008-03-13
> 322008-11-21
> 462009-01-21
>
> A field has been added for current order to this table:
>
> ID PRODUCT DATEORDERED FLAGCURRENT
>
> I need to update all records in the tabl
I have a table like this:
ID PRODUCT DATEORDERED
152005-02-18
222008-03-13
322008-11-21
462009-01-21
A field has been added for current order to this table:
ID PRODUCT DATEORDERED FLAGCURRENT
I need to update
MySQL DBA
We seek to hire a talented MySQL DBA to join our dynamic teams in California
and Miami. Both roles are for
onsite roles (no telecommuting). We are a well established multimedia/online
dating organization focused
primarily on the development of Internet media properties and is a lea
How about this?
update t set onoffflag = if (name <> 'China', onoffflag, ( if (location =
'Table', 1, 0) ));
This leaves any onoffflag untouched if name is not China, which I assume you
wanted to do.
On Thu, Jan 8, 2009 at 2:18 PM, Christoph Boget
wrote:
>
Consider the folowing dataset:
+++-+-+---+
| id| Name | Location| OnOffFlag | Description |
+++-+-+---+
| 1 | Paper| Cabinet | 0 | Blah|
| 2
For the curious: As usual "select is not broken".
Lesson learned: Always watch out for warnings:
http://bugs.mysql.com/bug.php?id=41007
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi Gautam
nope yours is not a bug. That's all fine. Hex numbers are 64 bit
unsigned.
So for -1 you have to insert cast(0x as signed).
Cheers,
Daniel
Hi Daniel,
I can see the problem without using "update". However, I am a newbie
at
mysql,
so can'
Hi Daniel,
I can see the problem without using "update". However, I am a newbie at
mysql,
so can't say for certain if it's a bug:
mysql> drop table if exists foo;
mysql> create table foo (id int signed, val bigint signed);
mysql> insert into foo values (0xf
Hi everybody -
I'm experiencing some really weird update behaviour (mysql 5.0) when
or'ing results from subselects using Long.MIN_VALUE.
But before I post a bug report I wanted to ask if I'm missing something.
drop table if exists foo;
drop table if exists bar;
create table
On Mon, Jul 21, 2008 at 2:43 PM, mos <[EMAIL PROTECTED]> wrote:
> I thought if MySQL found a duplicate key on the insert, it would
> automatically update the existing row that it found with the results from
> table1 if I left out the column expressions in the update clause. But
rows
then a Replace will work fine (but it would also execute Delete/Insert
triggers if I had any). But I have 50 million rows and will need to update
maybe 1/2% of those, all of those deletes and inserts will slow things down.
Now logically I thought this should work:
insert into Table2 select
ote:
>> > Is there a way to get "Insert ... select ... On Duplicate Update" to
>> update
>> > the row with the duplicate key?
>>
>> That's what it does.
>>
>> > Why can't it do this?
>>
>> What makes you think i
At 11:00 AM 7/21/2008, Perrin Harkins wrote:
On Mon, Jul 21, 2008 at 11:44 AM, mos <[EMAIL PROTECTED]> wrote:
> I can't specify all of the columns in a Set statement in the
> OnDuplicate clause because I don't know what the column names are and there
> could be 100 columns.
Write code to d
On Mon, Jul 21, 2008 at 11:44 AM, mos <[EMAIL PROTECTED]> wrote:
> I can't specify all of the columns in a Set statement in the
> OnDuplicate clause because I don't know what the column names are and there
> could be 100 columns.
Write code to do it. There is no way around specifying the co
At 08:23 PM 7/20/2008, Perrin Harkins wrote:
On Sun, Jul 20, 2008 at 12:12 AM, mos <[EMAIL PROTECTED]> wrote:
> Is there a way to get "Insert ... select ... On Duplicate Update" to
update
> the row with the duplicate key?
That's what it does.
> Why can't i
On Sun, Jul 20, 2008 at 12:12 AM, mos <[EMAIL PROTECTED]> wrote:
> Is there a way to get "Insert ... select ... On Duplicate Update" to update
> the row with the duplicate key?
That's what it does.
> Why can't it do this?
What makes you think it can't?
Is there a way to get "Insert ... select ... On Duplicate Update" to
update the row with the duplicate key? Otherwise I'll have to use Replace
which is inefficient because it deletes the old duplicated row and then
inserts the new row with the same key. I'd much rathe
Thanks, I'll take a look at that.
Appreciate the help,
Waynn
On Sat, Jul 12, 2008 at 9:02 PM, Rob Wultsch <[EMAIL PROTECTED]> wrote:
> On Sat, Jul 12, 2008 at 8:01 PM, Waynn Lue <[EMAIL PROTECTED]> wrote:
> > Is there any way to have an UPDATE statement change a colum
On Tue, Jul 15, 2008 at 7:59 AM, Guenter Ladstaetter
<[EMAIL PROTECTED]> wrote:
> UPDATE `phpbt_bug`
> SET title = REPLACE (phpbt_bug.title,"ö","ö")
> WHERE bug_id IN
> (select bug_id, title from phpbt_bug where `title` LIKE "%ö%");
>
>
>
Hello,
i'm trying to replace german umlauts by using a simple update replace statement
but can't find the syntax error:
UPDATE `phpbt_bug`
SET title = REPLACE (phpbt_bug.title,"ö","ö")
WHERE bug_id IN
(select bug_id, title from phpbt_bug where `title` LIKE
On Sat, Jul 12, 2008 at 8:01 PM, Waynn Lue <[EMAIL PROTECTED]> wrote:
> Is there any way to have an UPDATE statement change a column value based on
> the WHERE statement?
>
> Essentially, I want to do something like this
>
> UPDATE Actions SET ActionsSent = WHERE ActionsR
Is there any way to have an UPDATE statement change a column value based on
the WHERE statement?
Essentially, I want to do something like this
UPDATE Actions SET ActionsSent = WHERE ActionsReceived =
where foo and bar change for multiple sets of values. Is there a way to do
this in one SQL
Here is my test.
Any way can retrieve the metadata.
On Fri, May 9, 2008 at 10:45 PM, Martijn Tonies <[EMAIL PROTECTED]>
wrote:
>
>
> > SHOW CREATE TABLE ...
>
> Yes, I thought so :-(
>
>
> From a coding point of view, this requires parsing...
>
> Why isn't there anything in "show full columns".
>
> SHOW CREATE TABLE ...
Yes, I thought so :-(
>From a coding point of view, this requires parsing...
Why isn't there anything in "show full columns".
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upsce
SHOW CREATE TABLE ...
Martijn Tonies wrote:
Hi,
How does one know if ON UPDATE CURRENT_TIMESTAMP was specified when
creating a column? How do I retrieve this bit of info from the metadata
queries?
(also MySQL 4.1)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL
Hi,
How does one know if ON UPDATE CURRENT_TIMESTAMP was specified when
creating a column? How do I retrieve this bit of info from the metadata
queries?
(also MySQL 4.1)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Product
n for the start.
andy
Brent Baisley wrote:
You can do it in a single UPDATE statement, but you do need a form of
a subquery. Why the aversion of a subquery? The simplest approach is
to first get what you want using a SELECT statement. Then change
SELECT to UPDATE and add your SET statement.
In your
datetime
I want to run a query that updates the last_visit column of user with
the MAX(event_time) row for which the user_id's match, but only if I
find an event:
update user U
set U.last_visit = (select max(L.event_time) from event_log L
where L.user_id = U.user_id)
I
datetime
I want to run a query that updates the last_visit column of user with
the MAX(event_time) row for which the user_id's match, but only if I
find an event:
update user U
set U.last_visit = (select max(L.event_time) from event_log L
where L.user_id = U.user_id
I
se in UPDATE
statement?
M
- Original Message - From: "Andy Wallace" <[EMAIL PROTECTED]>
To: "mysql list"
Sent: Wednesday, May 07, 2008 1:07 PM
Subject: Re: question about update/join query
Clarification: I DON'T want to update the last_visit field if the
Clarification: I DON'T want to update the last_visit field if there
is no matching event record...
I managed to get this to sort of work:
update enduser E
set E.last_visit = (select MAX(EL.event_time)
from event_log EL
where EL.enduser
Hey all -
I have two tables - an event_log table, and a user table. There is
a "last_visit" column in the user table, and I want to update it from
the event_log with the most recent event timestamp. And I want to do
it without a subquery, eventually, both these tables will be pr
> -Original Message-
> From: Albert E. Whale [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 02, 2008 4:06 PM
> To: mysql@lists.mysql.com
> Subject: Update with select
>
> I am trying to update a field on a record in a table. Here is the
> statement I create
You are better off with an UPDATE JOIN
UPDATE pdata A,pdata B
SET A.pvalue = B.pvalue
WHERE A.pentrytime = 117540
AND B.pentrytime = 1207022400;
Give it a try !!!
-Original Message-
From: Albert E. Whale [mailto:[EMAIL PROTECTED]
Sent: Friday, May 02, 2008 4:06 PM
To: mysql
I am trying to update a field on a record in a table. Here is the
statement I created:
UPDATE pdata SET pvalue = ( SELECT pvalue
FROM pdata
WHERE pentrytime =1207022400 )
WHERE pentrytime =117540;
However, I get the following error:
|#1093 - You can't specify target table '
update newslettercontent c set c.timestamp= (select n.publishdate from
newsletter n where
n.NLCID= c.NLCID);
This should work.
On 4/16/08, Chris W <[EMAIL PROTECTED]> wrote:
>
> I have the following query...
>
> SELECT c.NLCID, n.publishdate
> FROM newsletter n
> JOIN n
Chris W schrieb:
I have the following query...
SELECT c.NLCID, n.publishdate
FROM newsletter n
JOIN newslettersection s using (NLID)
JOIN newslettercontent c using(NLCID)
WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00
00:00:00'
I want to run an
I have the following query...
SELECT c.NLCID, n.publishdate
FROM newsletter n
JOIN newslettersection s using (NLID)
JOIN newslettercontent c using(NLCID)
WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00
00:00:00'
I want to run an update on newslettercontent a
Hi,
table table1 int1 int auto_increament ,
date date not null default '-00-00'
1) insert into table1 (date) values('. . ')
// shows Incorrect date value: '. . ' for column date' at row 1
// '. . ' ==&g
rajapati
>
> On Fri, Apr 4, 2008 at 2:28 PM, Ananda Kumar <[EMAIL PROTECTED]> wrote:
>
> > so, we should not have --log-slave-update on slaves on setup with one
> > master and multiple slaves...right.
> >
> > regards
> > anandkl
> >
> >
>
ati
>
> On Fri, Apr 4, 2008 at 2:28 PM, Ananda Kumar <[EMAIL PROTECTED]> wrote:
>
> > so, we should not have --log-slave-update on slaves on setup with one
> > master and multiple slaves...right.
> >
> > regards
> > anandkl
> >
> >
> > On 4/
odel then --log_slave_updates is
required. Other in 1 to many model --log_slave_updates is not required
Thanks,
Krishna Chandra Prajapati
On Fri, Apr 4, 2008 at 2:28 PM, Ananda Kumar <[EMAIL PROTECTED]> wrote:
> so, we should not have --log-slave-update on slaves on setup with one
>
so, we should not have --log-slave-update on slaves on setup with one master
and multiple slaves...right.
regards
anandkl
On 4/4/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote:
>
> In case of master is down. Slave 1 has to be made as master and
> --log_slave_updates ha
e master and if log-slave-update
> is set on it, then
> slave2 might receive data that it might have arleady got from the old
> master, which might cause errors like "duplicate keys" etc.
>
>
> On 4/3/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]> wrote:
>
But, it also says, that if slave1 is made master and if log-slave-update is
set on it, then
slave2 might receive data that it might have arleady got from the old
master, which might cause errors like "duplicate keys" etc.
On 4/3/08, Krishna Chandra Prajapati <[EMAIL PROTECTED]&g
all
the queries to binlog. In this way 2nd slave get the updates from 1st
slave.
Krishna Chandra Prajapati
On Thu, Apr 3, 2008 at 12:02 PM, Ananda Kumar <[EMAIL PROTECTED]> wrote:
> Hi All,
> I have Master - Slave setup, with just one slave.
> Can i set --log-slave-update on sl
Hi All,
I have Master - Slave setup, with just one slave.
Can i set --log-slave-update on slave.
I have mysql running on debain with 8 cpu and 8 GB RAM.
Also in this link
http://dev.mysql.com/doc/refman/5.0/en/replication-solutions-switch.html
Its says not to set --log-slave-update on slave
riginal Message -
From: "Daniel Brown" <[EMAIL PROTECTED]>
To: "Velen" <[EMAIL PROTECTED]>
Cc:
Sent: Friday, March 21, 2008 6:10 PM
Subject: Re: Optimize db update
> On Fri, Mar 21, 2008 at 10:04 AM, Velen <[EMAIL PROTECTED]> wrote:
> > This one i
On Fri, Mar 21, 2008 at 10:04 AM, Velen <[EMAIL PROTECTED]> wrote:
> This one is alright but is there an alternative that can be run with the
> mysql> prompt?
Not to dump a file, but to import, yes. Check out the LOAD DATA
INFILE command:
http://dev.mysql.com/doc/refman/5.0/en/load-d
This one is alright but is there an alternative that can be run with the
mysql> prompt?
Thanks.
Velen
- Original Message -
From: "Daniel Brown" <[EMAIL PROTECTED]>
To: "Velen" <[EMAIL PROTECTED]>
Cc:
Sent: Friday, March 21, 2008 6:00 PM
Subject: Re:
On Fri, Mar 21, 2008 at 9:14 AM, Velen <[EMAIL PROTECTED]> wrote:
> This does not solve my problem. DatabaseA and DatabaseB are on 2 seperate
> pc and the only communication that can be use between the two PC is a USB
> pendrive.
>
> Is there another way of copying a table from one Database to
This does not solve my problem. DatabaseA and DatabaseB are on 2 seperate
pc and the only communication that can be use between the two PC is a USB
pendrive.
Is there another way of copying a table from one Database to another?
I don't want to update TableA directly as I want to validat
Are the table structures identical ?
If so, you could just move the data files themselves.
Otherwise consider using
unload from table B into seperated format (mysql load format)
truncate table A
load data infile into table A
On Thu, Mar 20, 2008 at 2:20 PM, Daniel Brown <[EMAIL PROTECTED]> w
On Thu, Mar 20, 2008 at 1:41 PM, Velen <[EMAIL PROTECTED]> wrote:
>
> Actually I am updating TableA in DatabaseA with values from TableB in
> DatabaseB. Database B is on a stand alone PC. I'm using VB6 to create a
> .txt file containing data from TableB then using VB6 once more to
> recronstr
Hi,
Actually I am updating TableA in DatabaseA with values from TableB in
DatabaseB. Database B is on a stand alone PC. I'm using VB6 to create a .txt
file containing data from TableB then using VB6 once more to recronstruct the
table in DatabaseA then remove all data which are already in Tab
Folks,
Thanks for the 'help'. Oy.
I figured it out from some help on the Lasso discussion list.
All I had to do was properly address ALL the tables I wanted to touch.
So this:
UPDATE tbe_gallery
SET tbe_gsa.gsa_paperprice = tbe_gallery.gallery_gsaprice_paper
WHERE tbe_gallery.
>
> I'm wondering if the following can be done
>
> UPDATE tbe_gallery
> SET tbe_gsa.gsa_paperprice = tbe_gallery.gallery_gsaprice_paper
> WHERE tbe_gallery.gallery_id = tbe_images.img_rel_id AND
>tbe_images.img_orig_filename = tbe_gsa.gsa_id
>
> Let me
Hi,
I'm wondering if the following can be done....
UPDATE tbe_gallery
SET tbe_gsa.gsa_paperprice = tbe_gallery.gallery_gsaprice_paper
WHERE tbe_gallery.gallery_id = tbe_images.img_rel_id AND
tbe_images.img_orig_filename = tbe_gsa.gsa_id
Let me explain:
I have 3 tables and only 1 of
Phil,
What happens if you drop the index when you do the update? Does it
run faster? If so then the index is slowing you down. Try increasing the
key_buffer_size to 756M. If there isn't much difference, try the update
without the "Order By" clause. If it runs considerably f
I'm trying to write an update which generates ranking data for a table.
Table is as follows
CREATE TABLE `A` ( `id` INT NOT NULL ,
`score` DOUBLE NOT NULL ,
`projrank` INT NOT NULL ,
`other` VARCHAR( 10 ) NOT NULL
) ENGINE = MYISAM
Real table actually contains 30 or so more fields but it
On 07.02.2008 03:52 CE(S)T, Chris wrote:
If you don't mind a mysql-specific "fix", and can get the data you want
from a select query you could:
insert into table (select goes here) on duplicate key update;
or maybe a replace into ?
INSERT/REPLACE ... SELECT will always overw
Yves Goergen wrote:
On 06.02.2008 08:12 CE(S)T, Chris wrote:
Yves Goergen wrote:
My goal was to copy some potentially large BLOB from one record to
another in the same table
Update table set blob2_field=blob1_field;
This does something totally different. ;) See my first posting why.
Ah
> -Original Message-
> From: Yves Goergen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 05, 2008 6:22 PM
> To: Baron Schwartz
> Cc: mysql@lists.mysql.com
> Subject: Re: Error: You can't specify target table '...' for update in
> FROM clause
&
On 06.02.2008 08:12 CE(S)T, Chris wrote:
Yves Goergen wrote:
My goal was to copy some potentially large BLOB from one record to
another in the same table
Update table set blob2_field=blob1_field;
This does something totally different. ;) See my first posting why.
--
Yves Goergen
to
fetch it from the database and have my application just write it back
again. I wanted to avoid this unnecessary copying around.
Update table set blob2_field=blob1_field;
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
from the database and have my application just write it back
again. I wanted to avoid this unnecessary copying around.
However, you can do multi-table updates like
this:
UPDATE tbl AS a
INNER JOIN tbl AS b ON
SET a.col = b.col
That sounds interesting, however, I couldn't find it in P
Hi,
On Feb 5, 2008 11:26 AM, Yves Goergen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've got an error message from MySQL 5.0 that I don't understand.
>
> UPDATE "message_revision" SET "HasData" = 1, "Data" = (SELECT "Data"
&
Hi,
I've got an error message from MySQL 5.0 that I don't understand.
UPDATE "message_revision" SET "HasData" = 1, "Data" = (SELECT "Data"
FROM "message_revision" WHERE "MessageId" = 7 AND "RevisionNumber" = 5)
W
Thomas Raso wrote:
Hi all,
I want to know the main differences between mysql 5.0.41 and MySQL
5.0.51a(last GA release)
I read this page :
http://dev.mysql.com/doc/refman/5.0/en/mysql-nutshell.html but there is
nothing about the developments made by such update...
thnaks all...
Try this
Hi all,
I want to know the main differences between mysql 5.0.41 and MySQL
5.0.51a(last GA release)
I read this page :
http://dev.mysql.com/doc/refman/5.0/en/mysql-nutshell.html but there is
nothing about the developments made by such update...
thnaks all...
> On Jan 30, 2008 12:50 PM, Dmitry E. Oboukhov wrote:
> > Is it possible to add to the syntax of the INSERT operator appoximately
> > in such way:
> > SELECT list INSERT [IGNORE] INTO ... - an added one.
> > SELECT list UPDATE - an added one.
>
> > PS:
On Jan 30, 2008 12:50 PM, Dmitry E. Oboukhov wrote:
> Is it possible to add to the syntax of the INSERT operator appoximately
> in such way:
> SELECT list INSERT [IGNORE] INTO ... - an added one.
> SELECT list UPDATE - an added one.
> PS: I understand that adding the changes
very often the resulting
values are needed at once for report representation or for using in
the next statements INSERT)
So: The INSERT(UPDATE) statement returns the quantity of
strings inserted(updated) into a table.
(*) However as far as I understand at the stage of fulfilling this
operator mysql oper
Hi,
I have a partitioned table based on hash, like so:
PARTITION BY HASH(id1)
PARTITIONS 1000;
I have lots and lots of rows (therefore the high number of partitions) and
since id1 is auto-incremented the distribution is pretty even.
The problem is that every night I need to update all rows
INSERT ... ON DUPLICATE KEY UPDATE:
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
Cheers,
Jay
J Trahair wrote:
This is a question I want to know the answer to, as well! Is there any way of
avoiding looking up a specific record in a table to see if it exists, before
This is a question I want to know the answer to, as well! Is there any way of
avoiding looking up a specific record in a table to see if it exists, before
deciding whether to INSERT INTO or UPDATE, eg:
mstrSQL = "SELECT * FROM Shops WHERE ShopReference = '" &
grd1.Tex
On Dec 16, 2007 10:29 AM, Afan Pasalic <[EMAIL PROTECTED]> wrote:
> try REPLACE
> http://dev.mysql.com/doc/refman/5.1/en/replace.html
>
> -afan
Replace will not do an update. All previous data will be lost.
A mysql-centric alternative solution would be to use INSERT ... ON
DU
possible to
insert if not there for example
Update
if anyone not found then insert new with same criteria as update
Where region_id in (2,3,4,5,6)
Thanks
Steffan
---
T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9
I am trying to think of a trick way to handle something. I have been
successful in using the multiple inserts in one row by using the
,(xx,xx,xx),(xx,xx,xx),(xx,xx,xx) in a values block. BUT Is it possible to
insert if not there for example
Update
if anyone not found then insert new
Hi everyone ,
I'm new to the mysql administration world
(couple months). Couple days ago a client came up with the following
situation he got logged out after editing a table (tt_content table part
of typo3) He thinks he was kicked out because he tried to upd
Hiep Nguyen wrote:
i have a loop to update my table:
update tbl_idea set col1 = 'text1', col2 = NOW() where ideaID = 1;
update tbl_idea set col1 = 'text2', col2 = NOW() where ideaID = 5;
...
update tbl_idea set col1 = 'textzzz', col2 = NOW() where ideaID = XXX;
On Dec 5, 2007 8:48 AM, Hiep Nguyen <[EMAIL PROTECTED]> wrote:
> hi list,
>
> i have a loop to update my table:
>
> update tbl_idea set col1 = 'text1', col2 = NOW() where ideaID = 1;
> update tbl_idea set col1 = 'text2', col2 = NOW() where ideaID = 5;
hi list,
i have a loop to update my table:
update tbl_idea set col1 = 'text1', col2 = NOW() where ideaID = 1;
update tbl_idea set col1 = 'text2', col2 = NOW() where ideaID = 5;
...
update tbl_idea set col1 = 'textzzz', col2 = NOW() where ideaID = XXX;
my q
d
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com
> -Original Message-
> From: Elissa Joan [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 12:05 PM
> To: mysql@lists.mysql.com
>
Hello.
I am having a time trying to get this to work. I hope someone can help me wit
the syntax!
Here is the original query:
UPDATE ambien_nev.Sections
INNER JOIN ambien_nev.Sections ON natural_db.Sections.section_id =
ambien_nev.Sections.section_id
SET ambien_nev.Sections.feature1
age-
> From: Hiep Nguyen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 29, 2007 10:24 AM
> To: mysql@lists.mysql.com
> Subject: repost timestamp for update & insert
>
> i asked this question before, but when i tried what D.Vin suggested, i
> got
> an error.
&g
Your missing your data type for the spdate_updated attribute
CREATE TABLE tbl_spdate(
spdate_ID int NOT NULL PRIMARY KEY AUTO_INCREMENT , spdate_date date NOT
NULL , spdate_notes varchar( 100 ) , spdate_created timestamp default 0,
spdate_updated timestamp default CURRENT_TIMESTAMP ON UPDATE
,
spdate_updated default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
and i got this:
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)'
n1
select * from quicktable;
+---+--+
| x | quick_id |
+---+--+
| 1 |0 |
+---+--+
1 row in set (0.00 sec)
I have a large number of connections executing these queries:
BEGIN:
SELECT quick_id FROM quicktable FOR UPDATE;
COMMIT;
This
works well until I hit a large
201 - 300 of 2398 matches
Mail list logo