Dino Geek, try to help you

How to use DATE function in MariaDB?


The DATE function in MariaDB is used to extract the date part of a datetime expression. It returns the date in the format ‘YYYY-MM-DD’. You can use it in the SELECT, WHERE, and ORDER BY clauses.

Here’s a simple syntax example:

```
SELECT DATE FROM table_name;
```

Let’s say for example you have a table called ‘orders’ and there’s a column called ‘order_date’ (which is of datetime type). If you want to retrieve only the date part of ‘order_date’, you can write:

```
SELECT DATE FROM orders;
```

If you want to select records having date part from ‘order\_date’ as ’2022-01-01’, you can write:

```
SELECT * FROM orders WHERE DATE = ’2022-01-01’;
```

Here’s how you’d use it in an ORDER BY clause:

```
SELECT * FROM orders ORDER BY DATE DESC;
```

It will return records ordered based on date part of ‘order\_date’ in descending order.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use