我有一個日期列,我正在使用查詢來從中獲取一組行。mySQL獲取下一個和前一個日期到當前行的日期
我不存儲任何時間值只是日期和T:00:00:00
我需要鍛鍊的是下一個和前幾天我有數據。
我希望能夠做一個單一的查詢和日期,使用下一個和背部UI導航與查詢選擇當前數據集
故有此開始得到最後一組數據
SELECT *
FROM `newco_bh_price_data`
WHERE `manager_id` =960
AND `currency_id` =0
AND `class_id` = 'A'
AND `price_date`
IN (SELECT MAX( `price_date`)
FROM `newco_bh_price_data`
)
我現在需要知道下一個日期是什麼,所以我可以在上面查詢任何幫助
SELECT *
FROM `newco_bh_price_data`
WHERE `manager_id` =960
AND `currency_id` =0
AND `class_id` = 'A'
AND `price_date` = '2002-09-19'
MANT感謝和評論
下面是數據
id price_date manager_id currency_id class_id value v_change
554 2002-09-19 960 0 A 8.631 0
553 2002-09-19 960 0 A 9.5635 0
552 2002-09-18 960 0 A 9.1068 0
551 2002-09-18 960 0 A 8.9351 0
550 2002-09-18 960 0 A 9.61 0
549 2002-09-17 960 0 A 9.1868 0
548 2002-09-17 960 0 A 9.0201 0
547 2002-09-17 960 0 A 9.6425 0
546 2002-09-16 960 0 A 9.3377 0
545 2002-09-16 960 0 A 9.3317 0
544 2002-09-16 960 0 A 9.6902 0
543 2002-09-13 960 0 A 9.418 0
542 2002-09-13 960 0 A 9.3669 0
541 2002-09-13 960 0 A 9.7125 0
540 2002-09-12 960 0 A 9.4463 0
539 2002-09-12 960 0 A 9.4383 0
538 2002-09-12 960 0 A 9.7474 0
537 2002-09-11 960 0 A 9.5303 0
536 2002-09-11 960 0 A 9.6592 0
535 2002-09-11 960 0 A 9.8041 0
534 2002-09-10 960 0 A 9.4666 0
533 2002-09-10 960 0 A 9.5878 0
532 2002-09-10 960 0 A 9.7651 0
531 2002-09-09 960 0 A 9.3104 0
530 2002-09-09 960 0 A 9.4841 0
529 2002-09-09 960 0 A 9.7498 0
528 2002-09-06 960 0 A 9.2462 0
527 2002-09-06 960 0 A 9.3823 0
526 2002-09-06 960 0 A 9.7501 0
525 2002-09-05 960 0 A 9.0465 0