如何检查不为空的条件 [英] how to check is not null condition

查看:95
本文介绍了如何检查不为空的条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


对于我的应用程序,我想基于Loan_Type
检索详细信息
我将通过在Valid_From和Valid_To之间以及
之间检查getdate()来获取详细信息 我也想在 Valid_To != null
时检索数据

hi ,
for my application i want to retrive the details based on Loan_Type

and i will get details by checking getdate() in between Valid_From and Valid_To and
also i want to retrive the data when Valid_To != null also

SELECT ID,
       Nature_Vehicle,
       Loan_Terms,
       Loan_Name,
       Interest_Rate,
       Interest_Type,
       Period_Type,
       Period_Value,
       Processing_Fee,
       Late_Repayment_Charges,
       Penal_Interest,
       Liability_Type,
       Required_Liability_Amount,
       Grace_Period,
       Mode_Repayment,
       Initial_Payment_Loan,
       Type_Property,
       From_Date,
       LockIn_Period,
       PrePayment_Interest,
       Is_Active,Valid_From ,Valid_To
 FROM Loan_Type WHERE Loan_Type = 1  AND GETDATE() BETWEEN Valid_From AND Valid_To 



?????????



?????????

推荐答案

SELECT ID,
Nature_Vehicle,
Loan_Terms,
Loan_Name,
Interest_Rate,
Interest_Type,
Period_Type,
Period_Value,
Processing_Fee,
Late_Repayment_Charges,
Penal_Interest,
Liability_Type,
Required_Liability_Amount,
Grace_Period,
Mode_Repayment,
Initial_Payment_Loan,
Type_Property,
From_Date,
LockIn_Period,
PrePayment_Interest,
Is_Active,Valid_From ,Valid_To
FROM Loan_Type WHERE Loan_Type = 1 AND GETDATE() BETWEEN Valid_From AND Valid_To and Valid_To is not null


ELECT ID,
       Nature_Vehicle,
       Loan_Terms,
       Loan_Name,
       Interest_Rate,
       Interest_Type,
       Period_Type,
       Period_Value,
       Processing_Fee,
       Late_Repayment_Charges,
       Penal_Interest,
       Liability_Type,
       Required_Liability_Amount,
       Grace_Period,
       Mode_Repayment,
       Initial_Payment_Loan,
       Type_Property,
       From_Date,
       LockIn_Period,
       PrePayment_Interest,
       Is_Active,Valid_From ,Valid_To
 FROM Loan_Type WHERE Loan_Type = 1  AND GETDATE() BETWEEN Valid_From AND Valid_To 
AND Valid_To IS NOT NULL


这篇关于如何检查不为空的条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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