AC
Size: a a a
AC
В🚙
IZ
IZ
IZ
V
select *
from (
select 'goga' first_name, 'boga' last_name, '' email
union all
select 'michael' first_name, 'jackson' last_name, '' email
union all
select 'goga' first_name, 'boga' last_name, '' email
union all
select '' first_name, '' last_name, 'michael.jackson@gmail.com' email
) t
order by case when concat_ws('.', first_name, last_name) = 'michael.jackson' then 1
when email like 'michael.jackson@%' then 2
else 3
end
IZ
V
with t as (select 'goga' first_name, 'boga' last_name, '' email
union all
select 'michael' first_name, 'jackson' last_name, '' email
union all
select 'goga' first_name, 'boga' last_name, '' email
union all
select '' first_name, '' last_name, 'michael.jackson@gmail.com' email)
select *
from t
order by case when concat_ws('.', first_name, last_name) = 'michael.jackson' then 1
when email like 'michael.jackson@%' then 2
else 3
end
D
`
SELECT DISTINCT contnet_id, content_type FROM (
SELECT * FROM audience_content ac
WHERE ac.category_id = ${categoryId} AND ac.building_id = ${buildingId}
) AS T
JOIN posts ON posts.id = content_id
JOIN offers ON offers.id = content_id
JOIN event_posts ON event_posts.id = content_id
LIMIT ${limit}
OFFSET ${offset}
`G