Home » questions » sql question?

sql question?

2006-08-19 22:51:30, Category: Programming & Design
when a table contains a column called date, how can we find out if it matches a specific year and get that data.(sql query)

Answers

  1. Beatmaster

    On 2006-08-20 00:02:23


    SELECT * FROM table_name WHERE year(`date` ) =some_value The reason why I've put date in accent quotes is that it may be a keyword in your SQL version and that could cause problems for you...I wouldn't recommend using date as a column name, though. I have tested this with MySQL and it works.
  2. terry

    On 2006-08-19 23:54:43


    select * from Table where Year("date")='2006'; it depends on the DataBase you're using the year function may be differ
  3. JJ

    On 2006-08-19 23:13:51


    type in calendar on google search