即时消息不知道如果我对这个字段做得很好calendar.type_event = NULL。现在对我很好,因为我需要将第二个SELECT区分为第三种类型。将一个值赋给SELECT语句上的一个字段
我想做点像calendar.type_event ='shared_event'来区分它。但返回一个0,用NULL返回什么都没有。这不是我只需要知道我是否可以分配自己的值的问题:'shared_event'。
非常感谢
整个查询:
(SELECT
id, type_event
FROM calendar
WHERE user_id = '.$user_id.'
)
UNION
(SELECT
calendar.id, calendar.type_event = NULL
FROM calendar
RIGHT JOIN avisos ON avisos.app_id = calendar.id
WHERE avisos.user_destiny_id = '.$user_id.'
)
ORDER BY fecha_evento ASC
什么数据类型是'calendar.type_event'? –
是一个字符串,有两种情况:'notice'或'event',需要在飞行中设置为'shared_event' – Theblabla
好的,然后检查下面的答案。它应该工作。 –