问题与选择和插入查询有关 [英] problem is related to select and insert query

查看:69
本文介绍了问题与选择和插入查询有关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,我正在编辑员工,并且在该页面的页面加载事件中,我正在检索员工的所有数据.
但是我想要一个,即在单击更新"按钮后,应该更新数据,并且之前的一个数据(我是指编辑之前的数据)应该保存在表中(在由我们创建的另一个表中,该表已经与该表相同)插入).

请帮助我进行SQL查询.

I have a page on that I am doing editing of employee and on that page''s page load event I am retrieving all the data of the employee.
But I would like one that i.e. after clicking on the update button the data should be updated and the previous one data (I mean the data before editing) should be saved in table (in another table that is made by us already same as the table of insertion).

Please help me with the SQL query for this.

推荐答案

首先从第一个表中获取数据并插入第二个表中,然后根据主键更新第一个表
First get the data from the first table and insert into second table and then update the first table based on primary key.


只需键入插入查询,例如

Just type the insert query like this

Insert into tablename values(employeename varchar(20))


这篇关于问题与选择和插入查询有关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆