Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mana
Posting Yak Master
102 Posts |
Posted - 2014-09-14 : 04:06:14
|
helloi have the following code but it has no result i have for each teil nummer in dbo.bewegungen several Von addresse in dbo.v_ME_Montage_Adressen but i want that just the first von address that will be found will be chosen for each teil nummer. can you help me please? am i right or shoud i write it in another way?thank youupdate dbo.Bewegungen_Inventur_Korrekturen set Von_Addresse = F.Von_AdresseFROM dbo.Bewegungen_Inventur_Korrekturen Minner join (select top 1 Von_Adresse ,Teil_Nummer from dbo.v_ME_Montage_Adressen order by Teil_Nummer ) FON F.Teil_Nummer = M.Teil_Nummer; |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-14 : 07:46:28
|
What do you mean by doesn't work1. Your query won't run at all or you get errors?2. No records are updated?3. Records are you updates incorrectly? If so, what would be correct?Looking at your query, you might want order by address |
|
|
|
|
|