SELECT EXTRACT(YEAR FROM '2018-07-22')
Code language: SQL (Structured Query Language) (sql)
SELECT FORMAT(<your-date-field>,"YYYY-MM") AS year-date FROM <your-table>
DECLARE @date date = '04-18-2020' --date for act;
SELECT YEAR(date), MONTH(date) --, DAY(date) add if u want day
SELECT
DATEADD(MONTH, DATEDIFF(MONTH, 0, <dateField>), 0) AS [year_month_date_field]
FROM
<your_table>
SELECT Name,
MONTH(ProducedDate) AS ProducedMonth
FROM Furniture;
Code Example |
---|
Sql :: how to put value in variable mysql |
Sql :: add a day big query |
Sql :: sql server case sensitive search |
Sql :: do postgresql |
Sql :: get foreign table names mysql |
Sql :: sp in sql server |
Sql :: incompatible sql_mode=only_full_group_by |
Sql :: psql create user |
Sql :: How to add a Try/Catch to SQL Stored Procedure |
Sql :: sql select first and last record of each group |
Sql :: empty table sqlite |
Sql :: sql command to show all tables |
Sql :: sql now |
Sql :: postgresql import a database of gzip |
Sql :: mysql grant select update insert delete |
Sql :: xampp mysql version |
Sql :: with postgres |
Sql :: date in oracle |
Sql :: mysql execute file |
Sql :: sql order by alphabetical |
Sql :: insert snowflake |
Sql :: select columns postgres |
Sql :: insert into select mysql |
Sql :: tinydb add table |
Sql :: postgres week number |
Sql :: SQL Duplicates by Composite |
Sql :: pivot |
Sql :: How to insert data in mysql ? |
Sql :: sql select row with max date |
Sql :: mysql add columns |