我正在使用 Postgres 并具有以下 SQL 语句:
SELECT *
FROM "osmlocal-dsd-de".t_osm_vehicle_image t
WHERE t.vehicle_config_id = 3
and image_type_id = 2
返回一行:
id vehicle_config_id cosy_url image_type_id
113 3 SomeValue 2
当我运行以下命令时:
SELECT * from "osmlocal-dsd-de".t_osm_vehicle_image t
WHERE t.vehicle_config_id = 3
and image_type_id = 2
and coalesce(t.cosy_url, '') = ''
返回零行。
我认为我的理解coalesce是错误的,因为我本以为仍然会返回一行,因为cosy_urlis not null。
任何关于我做错了什么的建议将不胜感激。