Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Quick SQL question

Name: Anonymous 2007-07-02 21:54 ID:q782/Tsx

any of you know MySQl.
How do I Select all entry that has column TODAY with type DATETIME that occur today? within 3 years?

Any thought?

Name: Anonymous 2007-07-02 22:24 ID:2WA9M7Kw

Query motherfucker, do you use it?

Name: Anonymous 2007-07-03 3:39 ID:MZDZ/OeB

>>1
Perhaps something like...

SELECT * FROM table WHERE TODAY >= (DATE(NOW()) - INTERVAL 3 YEAR) AND DAY(NOW()) = DAY(TODAY) AND MONTH(NOW()) = MONTH(TODAY)

(date in table must be the same or greater as today's date without time minus 3 years, and date in the table must have the same month and day as now.

You may want to save DATE(NOW()), DAY(NOW()) and MONTH(NOW()) into session variables (with SET @var = ...) so you can use @var instead of function calls, which is faster.

Name: Anonymous 2007-07-03 14:48 ID:VYwC4Eoh

SQL> SELECT * FROM girls WHERE want_sex = 1 ORDER BY tits DESC
Empty results (0.00 sec)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List