473,382 Members | 1,622 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,382 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 1565
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.