How to do common table expressions in laravel / eloquent for mysql 8?
问题 what is the proper way of doing CTE common table expressions in laravel 5.7? consider this sql: WITH SearchTerm AS ( SELECT ROW_NUMBER() OVER (ORDER BY created_at) AS search_term_order , jobs.* FROM jobs WHERE description LIKE '%programmer%' ), PremiumAdd AS ( SELECT ROW_NUMBER() OVER (ORDER BY created_at DESC) AS premium_order , jobs.* FROM jobs WHERE is_premium = 1 ), FinalOrder AS ( SELECT id , description , created_at , is_premium , MOD(search_term_order + 1, 2) + FLOOR((search_term_order