471,052 Members | 1,366 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,052 software developers and data experts.

Update query syntax question (probably easy)

I am attempting to run the folliwing update:

update rx set
startdate = date_sub(startdate, INTERVAL 14 DAY)
where rowid in
(
select rx.rowid
from rx, episode
where rx.rxbatch=0 and rx.handwritten=0
and episode.patient=rx.patient and episode.doctor=1029
and episode.enddate=0 and episode.startdate <> 0
)

But I get a syntax error.

I have not used MYSQL for a while, so could anybody explain the
correct syntax for updating data based on the values returned in a
select list ?

Thanks in advance.

Iain.
Jul 20 '05 #1
3 1236
If I remember correctly now, you cannot do sub SQL statements in MYSQL.

So I have done it another way.

Iain (again).
Jul 20 '05 #2
I believe you can do the subquery in 4.1.
co********@yahoo.co.uk (Iain) wrote in message news:<14**************************@posting.google. com>...
If I remember correctly now, you cannot do sub SQL statements in MYSQL.

So I have done it another way.

Iain (again).

Jul 20 '05 #3
That is very interesting, thank you.

I always liked Mysql, but been doing too much M$ work recently !

Ta.

Iain.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by David | last post: by
4 posts views Thread by Karaoke Prince | last post: by
14 posts views Thread by bolidev | last post: by
17 posts views Thread by kalamos | last post: by
9 posts views Thread by zMisc | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.