从表中选择空值时,View中的默认值 [英] Default value in View when selecting null value from table

查看:99
本文介绍了从表中选择空值时,View中的默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



我有一张桌子如:

========

学生

========

第1栏:身份证(整数)

第2栏:生日(日期时间)





现在,我将创建一个来自STUDENT表的视图,条件如下:

如果生日是null,查看显示值为01/01/1900



====================

创建视图vSTUDENT为

选择

st.ID,

st.Birthday ???

来自学生st

===============================



请帮帮我

谢谢

Dear all,

I have a table such as:
========
STUDENT
========
Column 1: ID (interger)
Column 2: Birthday (datetime)


Now, I would create a View from STUDENT table with condition such as:
If Birthday is null, View display that value is 01/01/1900

====================
Create View vSTUDENT As
Select
st.ID,
st.Birthday ???
From STUDENT st
===============================

Please help me
Thanks

推荐答案

设置默认值 - 上一个场-IN-A-表 - only-if-null [ ^ ]



query-to-return-default-value-if-column.html [ ^ ]



检查链接..希望它会有所帮助..
set-default-value-on-a-field-in-a-table-only-if-null[^]

query-to-return-default-value-if-column.html[^]

Check the links..hope it will help..


Create View vSTUDENT As
Select
st.ID,
ISNULL(st.Birthday,'01/01/1900') AS BirthDate
From STUDENT st





谢谢,

Mamun



Thanks,
Mamun


这篇关于从表中选择空值时,View中的默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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