我写了这个查询,但结果是空的。如何打印没有空行的结果。我将附上结果的屏幕截图。
SELECT user_data.alternative_mail
FROM user_data
JOIN users_map
ON users_map.user_id = user_data.user_id
WHERE users_map.service_id = 1 AND
users_map.service_user_id = 0 AND
user_data.alternative_mail NOT LIKE '%@abv.bg'
答案 0 :(得分:1)
您可以检查电子邮件IS NOT NULL
是否为空字符串:
SELECT user_data.alternative_mail
FROM user_data
JOIN users_map
ON users_map.user_id = user_data.user_id
WHERE users_map.service_id = 1
AND users_map.service_user_id = 0
AND user_data.alternative_mail NOT LIKE '%@abv.bg'
AND user_data.alternative_mail IS NOT NULL
AND user_data.alternative_mail <> '';