UPDATE table1, (select top 1 [ID],chef,formateur,techni from table1 order by Num desc)
AS x SET table2.ID = x.[ID], table2.Nom = x.[chef], table2.Nom = x.[formateur],
table2.Nom = x.[techni]
WHERE table2.mission="chef" and table2.mission="Formateur" and table2.mission="techni" ;
returns
table2 table 1
ID | mission |Nom| ID |chef|Formateur|techni|
-------------------------------- ----------------------------
1 | chef | | 1 |nom1| nom2 | nom3|
2 | Formateur | | **Result**
3 | techni | | ID | mission | Nom|
--------------------------
1 | chef | nom1|
2 | Formateur| nom2|
3 | techni | nom3|
答案 0 :(得分:0)
insert into table3(ID, categorie, DATE, Projets)
select ID, categorie, DATE, Projects, 'projetX'
from table2
<强>更新强>
我认为这回答了您更新的问题(您的表名和列名不一致,所以我不确定):
update TACHES_TEMPLATE, (select top 1 [Libelle Projects] from Projects order by ID desc) x
set TACHES_TEMPLATE.projets = x.[Libelle Projects]