Mailinglisten-Archive |
> >select * from table where field between '2001-01-01 00:00:00' and > >'2001-03-01 23:59:59'; > > > >-boris > > > Hi > > diesen Ansatz hatte ich vorher auch mal probiert, aber das > funktioniert so > leider nicht. Between ist wohl nicht auf Datumsberechnung > anwendbar, oder > ich habe etwas falsch gemacht. Da ich jedoch etlich > variationen mit BETWEEN > versucht habe bin ich relativ sicher, dass das nicht funktioniert. Also bei mir funtioniert das ziemlich gut. mysql> select datetime,id from [tabelle] where datetime between '2001-12-01 00:04:00' and '2001-12-01 00:24:00'; +---------------------+-------+ | datetime | id | +---------------------+-------+ | 2001-12-01 00:04:23 | 18914 | | 2001-12-01 00:04:25 | 18915 | | 2001-12-01 00:04:25 | 18916 | | 2001-12-01 00:04:25 | 18917 | | 2001-12-01 00:04:26 | 18918 | | 2001-12-01 00:04:26 | 18919 | | 2001-12-01 00:04:26 | 18920 | | 2001-12-01 00:04:26 | 18921 | | 2001-12-01 00:04:26 | 18922 | | 2001-12-01 00:04:27 | 18923 | | 2001-12-01 00:04:28 | 18924 | | 2001-12-01 00:04:30 | 18925 | | 2001-12-01 00:04:33 | 18926 | | 2001-12-01 00:04:37 | 18927 | | 2001-12-01 00:04:43 | 18928 | | 2001-12-01 00:04:50 | 18929 | | 2001-12-01 00:04:53 | 18930 | | 2001-12-01 00:04:56 | 18931 | | 2001-12-01 00:05:03 | 18932 | | 2001-12-01 00:05:15 | 18933 | | 2001-12-01 00:05:18 | 18934 | | 2001-12-01 00:05:26 | 18935 | | 2001-12-01 00:05:26 | 18936 | | 2001-12-01 00:05:26 | 18937 | | 2001-12-01 00:05:26 | 18938 | | 2001-12-01 00:05:27 | 18939 | | 2001-12-01 00:05:27 | 18940 | | 2001-12-01 00:05:27 | 18941 | | 2001-12-01 00:05:27 | 18942 | | 2001-12-01 00:05:27 | 18943 | | 2001-12-01 00:05:29 | 18944 | | 2001-12-01 00:05:41 | 18945 | | 2001-12-01 00:15:08 | 18946 | | 2001-12-01 00:19:44 | 18947 | | 2001-12-01 00:19:44 | 18948 | | 2001-12-01 00:19:44 | 18949 | | 2001-12-01 00:19:44 | 18950 | | 2001-12-01 00:19:44 | 18951 | | 2001-12-01 00:19:45 | 18952 | | 2001-12-01 00:19:45 | 18953 | | 2001-12-01 00:19:45 | 18954 | | 2001-12-01 00:19:45 | 18955 | | 2001-12-01 00:19:45 | 18956 | | 2001-12-01 00:19:46 | 18957 | | 2001-12-01 00:19:46 | 18958 | | 2001-12-01 00:19:48 | 18959 | | 2001-12-01 00:19:50 | 18960 | | 2001-12-01 00:19:54 | 18961 | | 2001-12-01 00:19:57 | 18962 | | 2001-12-01 00:19:57 | 18963 | | 2001-12-01 00:20:05 | 18964 | | 2001-12-01 00:20:06 | 18965 | | 2001-12-01 00:20:10 | 18966 | | 2001-12-01 00:23:01 | 18967 | +---------------------+-------+ 54 rows in set (0.02 sec) -boris
php::bar PHP Wiki - Listenarchive