要观看已经过更改的SQL列 [英] To watch SQL column which has been changed recentely

查看:74
本文介绍了要观看已经过更改的SQL列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在表中查看sql列,最近使用上次修改日期更改了



你可以帮我查询最新的更改。



原始表:



I need to watch sql columns in table, which has been recently changed with out using last modified date

Could you help me to sql query for latest changes.

original table:

S.No Employee id       First Name   Last Name   Address 1
1    00007          J           Siva        East st
2    020007         G           Moorthy         West street
3    300007         gan         thanu           East st
4    100007             esh         Moor            West street





修改后的表格





modified table

S.No Employee id       First Name   Last Name   Address 1
1    00007          Jun        Siva      East st
2    020007         Gon    Moorthy   West street
3    300007         gan         thanu           East st
4    100007             esh         Moor            West street







so我只需要获取2行以下。






so i need to fetch only below 2 rows.

S.No Employee id       First Name   Last Name   Address 1
1    00007          Jun        Siva      East st
2    020007         Gon    Moorthy   West street





我的尝试:





What I have tried:

original table:

<pre>	S.No Employee id       First Name	Last Name	Address 1
	1    00007	        J	        Siva    	East st
	2    020007     	G	        Moorthy	        West street
	3    300007	        gan	        thanu	        East st
	4    100007 	        esh	        Moor	        West street





修改后的表格





modified table

S.No Employee id       First Name   Last Name   Address 1
1    00007          Jun        Siva      East st
2    020007         Gon    Moorthy   West street
3    300007         gan         thanu           East st
4    100007             esh         Moor            West street







所以我只需要获取2行以下。






so i need to fetch only below 2 rows.

S.No Employee id       First Name   Last Name   Address 1
1    00007          Jun        Siva      East st
2    020007         Gon    Moorthy   West street

解决方案

不确定我是否理解你的问题。但是,如果你有两个表,修改过的和原始的,你可以使用EXCEPT运算符



例如

Not sure if I understand your question correctly. But if you have both tables, the modidied and the original, you can perhaps use EXCEPT operator

For example
SELECT SNo, EmployeeId, FirstName,LastName, Address
FROM ModifiedTable
EXCEPT
SELECT SNo, EmployeeId, FirstName,LastName, Address
FROM OriginalTable


如果您没有使用一行时间戳定义表,则无法这样做......
If you hadn't defined your table with a row of timestamp there is no way to do it...


这篇关于要观看已经过更改的SQL列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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