![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 72 Pomógł: 0 Dołączył: 17.02.2007 Ostrzeżenie: (0%) ![]() ![]() |
Chce wyswietlac z tabeli rekordy z ostatniego tygodnia. Jak powinno wygladac zapytanie SQL?
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Moderatorzy Postów: 36 559 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
Wbrew pozorom manual nie gryzie:
http://dev.mysql.com/doc/refman/5.0/en/dat...-functions.html (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Cytat Here is an example that uses date functions. The following query selects all rows with a date_col value from within the last 30 days:
mysql> SELECT something FROM tbl_name -> WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= date_col; |
|
|
![]() ![]() |
![]() |
Aktualny czas: 3.10.2025 - 16:57 |