SELECT * FROM (
SELECT
table.*,
CASE
WHEN type='video' THEN row_number() OVER (PARTITION BY type ORDER BY create_date) *2
ELSE row_number() OVER (PARTITION BY type ORDER BY create_date) +1
END ord
FROM table
) result ORDER BY ord, type DESC