更新现有列所需的更新查询 [英] Update Query needed to update the existing column
问题描述
我需要将一个列的值替换为另一个。
示例:
否Update_count Update_time
1 0 2015-02-02 12:23:24
1 0 2015-02-02 12:23:24
1 0 2015-02-02 12 :24:25
对于特定的No和更新计数,时间应该相同,在这种情况下我需要设置Max(update_time)作为所有3条记录的时间,可以有人请帮助。
结果应该是这样的:
没有Update_count Update_time
1 0 2015-02- 02 12:24:25
1 0 2015-02-02 12:24:25
1 0 2015-02-02 12:24:25
I need to replace one value of a column to another.
Example :
No Update_count Update_time
1 0 2015-02-02 12:23:24
1 0 2015-02-02 12:23:24
1 0 2015-02-02 12:24:25
For a particular No and update count the time should be same , in this case i need to set Max(update_time) as the time for all 3 records , Can someone help please.
Result should be like this :
No Update_count Update_time
1 0 2015-02-02 12:24:25
1 0 2015-02-02 12:24:25
1 0 2015-02-02 12:24:25
推荐答案
你有什么问题?你不知道怎么写更新查询?或者您不知道如何编写查询来检索最大值?或者你不知道如何将两者合并?
What problem are you having? Do you not know how to write an update query? Or do you not know how to write a query to retrieve the max value? Or do you not know how to combine the two?
表中有很多数字,我需要放置如果更新计数相同,则为max update_time。
对于特定的更新时间和否,更新时间应该相同,如果它不同,那么我需要用更新计数的Max(update_time)替换它。
我希望你能得到我的问题
Hi ,
There are lot of numbers in the table , i need to place the max update_time if the update count is same .
For a particular update time and No the update time should be same , if its different then i need to replace it with the Max(update_time) for that update count.
I hope u got my question
我理解这个问题。我不明白你遇到问题的哪一部分。请回答我原来的问题。
I understand the question. I don''t understand which part of the question you''re having trouble with. Please answer my original questions.
这篇关于更新现有列所需的更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!