查询数据库为空时自动填充

SELECT
	sti.station_id,
	sti.station_name,
CASE	
	WHEN sti.station_img  is null THEN
	'*' 
	else sti.station_img
END  as  img
FROM
	station_info sti
	INNER JOIN station_banner stc ON stc.station_id = sti.station_id 
	AND stc.`status` = 0

图如下,后面的as img 后加的
查询数据库为空时自动填充_第1张图片

SELECT
	sti.station_id,
	sti.station_name,

	sti.station_img 

FROM
	station_info sti
	INNER JOIN station_banner stc ON stc.station_id = sti.station_id 
	AND stc.`status` = 0

图如下
查询数据库为空时自动填充_第2张图片

你可能感兴趣的:(查询数据库为空时自动填充)