1.a)
[sql]
SELECT *
FROM table1
WHERE `date`
LIKE CONCAT( EXTRACT( YEAR
FROM NOW( ) ) , '-', EXTRACT(
MONTH FROM NOW( ) ) -1, '%' )
[/sql]
1.b)
[sql]
SELECT *
FROM table1
WHERE `date`
LIKE CONCAT( YEAR(CURRENT_DATE), '-', MONTH(CURRENT_DATE) -1, '%' )
[/sql]
2.a)
[sql]
SELECT *
FROM table1
WHERE `date`
BETWEEN CONCAT( EXTRACT( YEAR
FROM NOW( ) ) , '-', EXTRACT(
MONTH FROM NOW( ) ) -1, '-01' ) AND DATE_SUB( CONCAT( EXTRACT( YEAR
FROM NOW( ) ) , '-', EXTRACT(
MONTH FROM NOW( ) ) , '-01' ) , INTERVAL 1
DAY )
[/sql]
2.b)
[sql]
SELECT *
FROM table1
WHERE `date`
BETWEEN CONCAT( YEAR(CURRENT_DATE) , '-', MONTH(CURRENT_DATE) -1, '-01' ) AND DATE_SUB( CONCAT( YEAR(CURRENT_DATE) , '-', MONTH(CURRENT_DATE) , '-01' ) , INTERVAL 1
DAY )
[/sql]