Created
November 15, 2017 21:13
-
-
Save charlesmudy/4a59fdc2549cc7619ddbf7387c8b05f1 to your computer and use it in GitHub Desktop.
This file contains 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
SELECT `user_listings`.*, `user_images`.*, `user_states`.*, COUNT(user_bookings.book_listing) as totally FROM `user_listings` JOIN `user_images` ON `user_images`.`img_listing` = `user_listings`.`list_reference` JOIN `user_states` ON `user_states`.`state_id` = `user_listings`.`list_state` LEFT JOIN `user_bookings` ON `user_bookings`.`book_listing` = `user_listings`.`list_reference` WHERE `list_status` = 1 AND `list_date` >= '2017-11-15' GROUP BY `user_listings`.`list_reference` ORDER BY `user_listings`.`list_created` DESC LIMIT 18 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment