@@ -760,3 +760,54 @@ call t_sysdate();
760
760
@a != @b
761
761
1
762
762
drop procedure t_sysdate;
763
+ select timestampdiff(month,'2004-09-11','2004-09-11');
764
+ timestampdiff(month,'2004-09-11','2004-09-11')
765
+ 0
766
+ select timestampdiff(month,'2004-09-11','2005-09-11');
767
+ timestampdiff(month,'2004-09-11','2005-09-11')
768
+ 12
769
+ select timestampdiff(month,'2004-09-11','2006-09-11');
770
+ timestampdiff(month,'2004-09-11','2006-09-11')
771
+ 24
772
+ select timestampdiff(month,'2004-09-11','2007-09-11');
773
+ timestampdiff(month,'2004-09-11','2007-09-11')
774
+ 36
775
+ select timestampdiff(month,'2005-09-11','2004-09-11');
776
+ timestampdiff(month,'2005-09-11','2004-09-11')
777
+ -12
778
+ select timestampdiff(month,'2005-09-11','2003-09-11');
779
+ timestampdiff(month,'2005-09-11','2003-09-11')
780
+ -24
781
+ select timestampdiff(month,'2004-02-28','2005-02-28');
782
+ timestampdiff(month,'2004-02-28','2005-02-28')
783
+ 12
784
+ select timestampdiff(month,'2004-02-29','2005-02-28');
785
+ timestampdiff(month,'2004-02-29','2005-02-28')
786
+ 11
787
+ select timestampdiff(month,'2004-02-28','2005-02-28');
788
+ timestampdiff(month,'2004-02-28','2005-02-28')
789
+ 12
790
+ select timestampdiff(month,'2004-03-29','2005-03-28');
791
+ timestampdiff(month,'2004-03-29','2005-03-28')
792
+ 11
793
+ select timestampdiff(month,'2003-02-28','2004-02-29');
794
+ timestampdiff(month,'2003-02-28','2004-02-29')
795
+ 12
796
+ select timestampdiff(month,'2003-02-28','2005-02-28');
797
+ timestampdiff(month,'2003-02-28','2005-02-28')
798
+ 24
799
+ select timestampdiff(month,'1999-09-11','2001-10-10');
800
+ timestampdiff(month,'1999-09-11','2001-10-10')
801
+ 24
802
+ select timestampdiff(month,'1999-09-11','2001-9-11');
803
+ timestampdiff(month,'1999-09-11','2001-9-11')
804
+ 24
805
+ select timestampdiff(year,'1999-09-11','2001-9-11');
806
+ timestampdiff(year,'1999-09-11','2001-9-11')
807
+ 2
808
+ select timestampdiff(year,'2004-02-28','2005-02-28');
809
+ timestampdiff(year,'2004-02-28','2005-02-28')
810
+ 1
811
+ select timestampdiff(year,'2004-02-29','2005-02-28');
812
+ timestampdiff(year,'2004-02-29','2005-02-28')
813
+ 0
0 commit comments