473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

SQL-Update-Statement

Hello!
I have a litte problem with my sql-database!
I have to update all UA-fields in the table idrz_kennzahl with primary
key idrz, where the same idrz in the table per_verwaltung with the
field Amt=12 is.

I designed following statement but it doesn't work:

update idrz_kennzahl
set UA=1234
where
idrz_kennzahl.idrz =
(SELECT per_verwaltung.idrz from per_verwaltung where
per_verwaltung.Amt=12)
Does anybody has an idea for my prob - sorry i'm an mysql-newbie!

Thanks,
Christian
Jul 19 '05 #1
6 1566
ch*******@web.de (Christian Freitag) wrote:
Hello! I have a litte problem with my sql-database! I have to update all
UA-fields in the table idrz_kennzahl with primary key idrz, where the same
idrz in the table per_verwaltung with the field Amt=12 is.

I designed following statement but it doesn't work:

update idrz_kennzahl set UA=1234 where idrz_kennzahl.idrz = (SELECT
per_verwaltung.idrz from per_verwaltung where per_verwaltung.Amt=12)
In good tradition, I've not time to test it, but try using:

UPDATE idrz_kennzahl, perverwalting SET idrz_kennzahl.UA=1234 WHERE
idrz_kennzahl.idrz=per_verwaltung.idrz AND per_verwaltung.Amt=12;

Does anybody has an idea for my prob - sorry i'm an mysql-newbie!


MySQL doesn't support sub-SELECTs. It's detailed in the accompanying
documentation somewhere in the UPDATE bit.

R.
--
Richard Wilson, Publications Manager
Tradelink Publications Ltd.
Jul 19 '05 #2
ch*******@web.de (Christian Freitag) wrote:
Hello! I have a litte problem with my sql-database! I have to update all
UA-fields in the table idrz_kennzahl with primary key idrz, where the same
idrz in the table per_verwaltung with the field Amt=12 is.

I designed following statement but it doesn't work:

update idrz_kennzahl set UA=1234 where idrz_kennzahl.idrz = (SELECT
per_verwaltung.idrz from per_verwaltung where per_verwaltung.Amt=12)
In good tradition, I've not time to test it, but try using:

UPDATE idrz_kennzahl, perverwalting SET idrz_kennzahl.UA=1234 WHERE
idrz_kennzahl.idrz=per_verwaltung.idrz AND per_verwaltung.Amt=12;

Does anybody has an idea for my prob - sorry i'm an mysql-newbie!


MySQL doesn't support sub-SELECTs. It's detailed in the accompanying
documentation somewhere in the UPDATE bit.

R.
--
Richard Wilson, Publications Manager
Tradelink Publications Ltd.
Jul 19 '05 #3
ch*******@web.de (Christian Freitag) wrote:
Hello! I have a litte problem with my sql-database! I have to update all
UA-fields in the table idrz_kennzahl with primary key idrz, where the same
idrz in the table per_verwaltung with the field Amt=12 is.

I designed following statement but it doesn't work:

update idrz_kennzahl set UA=1234 where idrz_kennzahl.idrz = (SELECT
per_verwaltung.idrz from per_verwaltung where per_verwaltung.Amt=12)
In good tradition, I've not time to test it, but try using:

UPDATE idrz_kennzahl, perverwalting SET idrz_kennzahl.UA=1234 WHERE
idrz_kennzahl.idrz=per_verwaltung.idrz AND per_verwaltung.Amt=12;

Does anybody has an idea for my prob - sorry i'm an mysql-newbie!


MySQL doesn't support sub-SELECTs. It's detailed in the accompanying
documentation somewhere in the UPDATE bit.

R.
--
Richard Wilson, Publications Manager
Tradelink Publications Ltd.
Jul 19 '05 #4
Richard Wilson wrote:
MySQL doesn't support sub-SELECTs. It's detailed in the accompanying
documentation somewhere in the UPDATE bit.


MySQL supports sub selects, starting from version 4.1

http://www.mysql.com/doc/en/ANSI_diff_Subqueries.html
Jul 19 '05 #5
Richard Wilson wrote:
MySQL doesn't support sub-SELECTs. It's detailed in the accompanying
documentation somewhere in the UPDATE bit.


MySQL supports sub selects, starting from version 4.1

http://www.mysql.com/doc/en/ANSI_diff_Subqueries.html
Jul 19 '05 #6
Richard Wilson wrote:
MySQL doesn't support sub-SELECTs. It's detailed in the accompanying
documentation somewhere in the UPDATE bit.


MySQL supports sub selects, starting from version 4.1

http://www.mysql.com/doc/en/ANSI_diff_Subqueries.html
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter | last post by:
I run most of my SQL scripts via kornshell on AIX. I use the "here-document" to run some of the smaller ones. Example: #!/bin/ksh # Analyze the table. sqlplus...
10
by: Dagwood | last post by:
Good morning: At least it's morning where I am. :) I have a rather newbie question I'm afraid. I have VisualStudio.NET, and have installed it along with SQL server. However I can't seem to...
2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: AlessanBar | last post by:
Hello Friends !! I have a strange problem, and I need to know what would be the source of this. I have a laptop computer with the following configuration: Pentium III Brand : Toshiba Speed :...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
3
by: datapro01 | last post by:
I am a DB2 DBA that has been asked to become familiar enough with SQL Server in order to become actively involved in its installation, implementation, and to review database backup/recovery...
16
by: Jeremy S. | last post by:
I'm about to install VS.NET 2005 and SQL Server 2005 on a new/clean development machine (XP Pro/SP2 etc). Is the order of installation important (i.e., which product should I install first)? ...
6
by: Fuzzydave | last post by:
I am back developing futher our Python/CGI based web application run by a Postgres DB and as per usual I am having some issues. It Involves a lot of Legacy code. All the actual SQL Querys are...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.