VB.NET Column创建 [英] VB.NET Collumn Creation

查看:153
本文介绍了VB.NET Column创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,我想问一个小问题。





我想知道是否有办法如何在数据库中创建一个字段,每次在计算机的日期比较它的另一个字段时将更新其字段。





进一步的讨论:



例如我有一个这样的字段和数据。



|名称|出生日期|年龄|

|保罗| 09/291993 | 19 |



如果列出生日期等于计算机日期,那么这些将是输出。





|名称|出生日期|年龄|

|保罗| 09/291993 | 20 |



有没有办法或其他方式如何做到这一点?

任何代码示例都将是一个很好的帮助。在这个问题我使用MySQL数据库。





谢谢。 :)

Good Day to all, i want to ask a small question.


I want to know if there is a way on how to create a field in a database that will update its field every-time a another field of it is compared in the computer's date.


Further Discussion:

For example i have a field and data like this.

| Name | Birth date | Age |
| Paul | 09/291993 | 19 |

and if the column birth date is equal to computers date then these will be the output.


| Name | Birth date | Age |
| Paul | 09/291993 | 20 |

is there a way or other way on how to do that?
Any code sample will be a great help. On this question im using MySQL Database.


Thank You. :)

推荐答案

通常这称为计算列,但这些值在插入或更新行时设置,而不是在读取时设置。



您所询问的内容通常在SELECT语句中完成。您可以在这里找到一个示例[ ^ ]。
Normally this is called a "computed column", but these values are set when the row is inserted or updated, not when it's read.

What you're asking is normally done in the SELECT statement. You can find an example here[^].


这篇关于VB.NET Column创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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