Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use interval keyWord in mySql

 
hitendra sunkara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

select yearweek_id,start_date,end_date from yearweek where start_date between date '2012-07-03' + INTERVAL '25 weeks' and date '2013-11-14' - INTERVAL '2 weeks'
when i have used this query in postgresSql,iam getting results,but when iam trying to use this in MySql iam getting error as
:


can you please help me in this
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not all databases use the SQL standard for date arithmetic. To search for a specific database implementation, I'd suggest using Google with keywords <database> date arithmetic, eg. mysql date arithmetic.
 
hitendra sunkara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to run this query in hibernate we need to add criteria for this like :



i need to write like this..
 
hitendra sunkara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used HQL for this ,now iam able to make it...i have added days by using Calendar class
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic