是否有像ISNULL()或COALESCE()类似的东西,但不是检查空值,而是检查空值。ISNULL等于空字段
例如:
SELECT cu.last_name, cu.first_name, cu.email, hu.email FROM
(SELECT DISTINCT c.first_name, c.last_name, c.email, c.household_id, h.head_of_household_id
FROM rd_customers c
JOIN rd_households h ON c.household_id = h.household_id
JOIN ad_registrations r ON r.customer_id = c.customer_id
JOIN ad_meeting_times a ON r.session_id = a.session_id and a.meeting_time_id = 203731) cu
LEFT JOIN rd_customers hu ON hu.customer_id = cu.head_of_household_id
,而不是返回四列,我想拿到三,第三个假设有两种cu.email或hu.email的值,如果第一个是空的! ISNULL和COALESCE不会在这里工作我不知道为什么
的任意组合是在C#!这可能是有用的。是的,我知道你可以创建一个标量函数,但是如果是本地的,比如ISNULL()等,会更好。希望SQL团队的MS员工读取这个=) 但是现在,我们必须手动完成,就像Andomar的回答显示=/ – Losbear 2013-07-25 13:21:32