"PostgreSQL" PostgreSQL syntax

Source: Internet
Author: User
Tags postgresql syntax

There are no problems in the reading process. Welcome to communicate together

Email:[email protected]

qq:1494713801

One, PostgreSQL time type conversion

--The time type is converted into character type select To_char (current_date, ' yyyy/mm/dd '); select To_char (current_date, ' yyyy-mm-dd '); select To_char (now (), ' yyyy-mm-dd '); select To_char (Current_timestamp, ' HH:MI:SS '); select To_char (Current_timestamp, ' yyyy/ Mm/dd HH:MI:SS '); --The string type is converted to the time type select To_date (' 2012/05/22 ', ' yyyy/mm/dd '); Select To_date (' 2012-05-22 ', ' yyyy-mm-dd '); select To_timestamp (' Sep ', ' DD mon YYYY '), select To_timestamp (' 2012/05/22 ', ' yyyy/mm/dd '); Select To_timestamp (' 2012/ 05/22 02:55:46 ', ' yyyy/mm/dd HH:MI:SS '); Select To_timestamp (' 2012/05/22 02:55:46 ', ' yyyy/mm/dd HH:MI:SS MS ');

Ii. postgresqL-Unique type conversion operator

:: is a type conversion operator

For example: AVG (accesscount):: int4--Converts the value of AVG (Accesscount) to Int4

"PostgreSQL" PostgreSQL syntax

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.