Re: Select Query problem
| From: | David Otton | Date: | Mon, 06 Oct 2003 06:30:26 +0000 |
| Subject: | Re: Select Query problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165142@lists.php.net to get a copy of this message | ||
On Mon, 6 Oct 2003 14:22:59 +0800, you wrote:
>Now my question is: What if I would like to display data for the CURRENT MONTH
>and the last 11 months???(May also said to be the LAST MONTHS)
>HOw should my select query be like??
This question isn't on-topic for this list; it's about SQL, not PHP. You'll
get a better response on a mailing list for users of your DB. You also
didn't mention which database you're using.
However, assuming MySQL I'd start by looking at the MONTH() function.
Something like
SELECT * FROM table WHERE MONTH(date_column) = 10;
(untested).