The introduction recently collated some of the most common commands for PostgreSQL, for reference 1 only. Common commands:
# time Word Fu timestampSelectExtract (Epoch fromDate'2018-04-11 23:59:59')); #1523404800# Timestamp to time stringSelectDate (To_timestamp (1523404800) # Timestamp to stringSelectTo_char (To_timestamp (1523404800),'YYYY-MM-DD HH24:MI:SS') # Convert numeric typeCAST(T3.userid as text) # int NUMERIC VARCHAR can also
# Default Value
coalesce(null, 1); # 1
2. Common numeric functions
AVG () returns the average of a column
COUNT () returns the number of rows in a column
Max () returns the maximum value of a column
MIN () returns the minimum value of a column
Sums () returns the sum of the values of a column
3. Commonly used String functions
Lengtah (s) calculates the string length
CONCAT (s1,s2,......) string merge function
Letrim (s)/rtrim (s)/trim (s) Delete string space function
Replace (S,S1,S2) string substitution function
SUBSTRING (s,n,len) Get substring function
4. Commonly used date and time functions
EXTRACT (type from D) Get date specified value function
Current_date getting the current date function
Current_time Get current time
Postgresql Common Commands