需要更新表,但系统需要检查字段是否为空 [英] Need to update a tables but the systems needs to check whether the fields are empty

查看:77
本文介绍了需要更新表,但系统需要检查字段是否为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要更新表格如下图所示:



table:master

----------- ----

idno

名称

date1

comment1

date2

comment2

date3

comment3

date4

comment4



更新程序应检查字段( date1 )是否为空并更新它



如果系统检查字段 date1 并且不为空,则应检查 date2 ,如果它为空,则应更新它,否则应继续 date3



请提供更新数据库中表格的程序。



谢谢



我尝试了什么:



审核了我的程序和其他人但发现没有这样的解决方案

Need to update a table as depicted below :

table : master
---------------
idno
name
date1
comment1
date2
comment2
date3
comment3
date4
comment4

The program for the update should check if the field (date1) is empty and update it

if the system checks the field date1 and is not empty should check date2 and if its empty it should update it else it should move on to date3.

Please provide the program to update the table in the database.

Thanks

What I have tried:

Reviewed my programs and others but found no such solution

推荐答案

引用:

请提供程序更新表格数据库。

Please provide the program to update the table in the database.



错误的网站。

如果你需要有人做你的工作/工作,请雇用专业人士。

< a href =https://www.freelancer.com>聘请自由职业者&在线查找自由职业者 - 自由职业者 [ ^ ]




Wrong site.
If you need someone to do your job/work, hire a professional.
Hire Freelancers & Find Freelance Jobs Online - Freelancer[^]

Quote:

审核了我的程序和其他人但发现没有这样的解决方案

Reviewed my programs and others but found no such solution



作为程序员,你的工作是创建算法解决特定问题,你不能依赖别人为你永远做到这一点,所以有一段时间你需要学习如何。而且越快越好。

当你要求解决方案时,就像试图通过培训其他人来学习开车一样。

创建算法基本上是找到数学并做出必要的调整以适应你的实际问题。



发展的概念就像这个词所暗示的那样:系统地使用科学和满足特定目标或要求的技术知识。 BusinessDictionary.com [ ^ ]

这与有一个不一样快速谷歌并放弃,如果我找不到正确的代码。


As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.

The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".


这样的东西:

Something like this:
UPDATE master SET [date1] = GETDATE() WHERE [date1] IS NULL


这篇关于需要更新表,但系统需要检查字段是否为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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