SELECT * from event where create_Date >= #{startDate} and create_Date <= #{endDate} and name = #{name};
SELECT * from event where create_Date >= #{startDate} and create_Date <= #{endDate} ;
SELECT * from event where name = #{name};
这3个sql语句怎么合为一条sql语句,且能满足3个各自的条件
SELECT *
from event
where create_Date >= #{startDate}
and create_Date <= #{endDate}
and name = #{name}
union
SELECT *
from event
where create_Date >= #{startDate}
and create_Date <= #{endDate}
union
SELECT * from event where name = #{name};
union可以去掉重复的数据