title: Postgres: How do I extract year and month from a date?
body: <p>One of my columns is a date type in the following format: YYYY-MM-DD. I want to extract YYYY-MM. So far, the resources I've come across show me that I can extract either year using <code>SELECT extract(year from order_date)...</code> but I can't figure out how to extract both the year and the month. I tried the following but it didn't work: <a href="https://www.w3schools.com/sql/func_mysql_extract.asp" rel="nofollow noreferrer">https://www.w3schools.com/sql/func_mysql_extract.asp</a> </p>