
Untitled
By: a guest on
Jun 13th, 2012 | syntax:
None | size: 0.97 KB | hits: 11 | expires: Never
Adding column_name != 3 returns much fewer results
select scheduled_hike_id
, hike_date
, hike_title
, hike_group_id
, hike_privacy
, hike_description
, DAYOFMONTH(hike_date)
, DAYNAME(hike_date)
, YEAR(hike_date)
, MONTH(hike_date)
from scheduled_hikes
where is_cancelled is null
and hike_date > DATE_ADD(NOW(), INTERVAL -1 DAY)
and show_on_home_page = 1
order by hike_date limit 4
where ( is_cancelled is null
and hike_date > DATE_ADD(NOW(), INTERVAL -1 DAY)
and show_on_home_page = 1
and hike_privacy != 3
)
or hike_privacy is null
where is_cancelled is null
and hike_date > DATE_ADD(NOW(), INTERVAL -1 DAY)
and show_on_home_page = 1
and (
hike_privacy != 3
or hike_privacy is null
)