从表中选择空值时,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