Created
August 13, 2020 01:43
-
-
Save xirukitepe/e49507d307438df827a8904e4cc15b1d to your computer and use it in GitHub Desktop.
SQL Query for LCL hire rate analysis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXPLAIN for: SELECT `jobs`.* FROM `jobs` INNER JOIN `bids` ON `bids`.`job_id` = `jobs`.`id` INNER JOIN `suburbs` ON `suburbs`.`id` = `jobs`.`suburb_id` WHERE (jobs.status NOT IN ('drafted','rejected') AND (jobs.status = 'stopped' OR bidding_closes_on < DATE(CURRENT_TIMESTAMP + INTERVAL 10 HOUR))) AND (DATE(jobs.created_at) >= '2020-06-09') AND (suburbs.region IN ('Sydney','Melbourne','Brisbane')) GROUP BY bids.job_id HAVING (count(bids.job_id) >= 1) ORDER BY jobs.id desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment