SQL select * from column where year = 2010

前端 未结 5 2381
别那么骄傲
别那么骄傲 2020-12-15 03:08

This is probably a simple where clause but I want to say, from columnX (which is datetime) I want all rows where just the year = 2010.

so:

select * f         


        
5条回答
  •  青春惊慌失措
    2020-12-15 03:52

    If i understand that you want all rows in the year 2010, then:

    select * 
      from mytable 
     where Columnx >= '2010-01-01 00:00:00' 
           and Columnx < '2011-01-01 00:00:00'
    

提交回复
热议问题