PostgreSQL tutorial (6): Functions and operators (2), postgresql Operators
6. Pattern Matching:
PostgreSQL provides three methods for implementing pattern matching: SQL LIKE operator, closer SIMILAR TO operator, and POSIX-style regular expression.1.
Vi. Pattern Matching:
PostgreSQL provides three ways to implement pattern matching: SQL Like operator, more recent similar to operator, and posix-style regular expression.1. Like:
Copy Code code as follows:
string like pattern
Those of us who use Rails will not be surprised when they see 5. weeks. from_nowor3.days.ago + 2. hours. Similarly, PostgreSQL can also achieve the same functionality by simply calling the built-in functions of PostgreSQL.
PostgreSQL deletes
1. Function Description:Date_trunc: Intercept a given time (timestamp,date) to get the initial time of the specified precision (time, day, month, year)2. General TimeDate_trunc (' Hour ', TIMESTAMP ' 2018-08-16 20:38:40 ')Result:2018-08-16
Those of us who use Rails will not be surprised when they see 5. weeks. from_nowor3.days.ago + 2. hours. You can also use PostgreSQL.
Those of us who use Rails will not be surprised when they see 5. weeks. from_nowor3.days.ago + 2. hours. You can
The time can be added and reduced directly in PostgreSQL: Query System Current Time: Select Now ();OrSelect Current_timestamp; SELECT now ():: Timestamp + ' 1 year '; --Current time plus 1 yearsSELECT now ():: Timestamp + ' 1 month '; --Current
Commonly used time and date scripts in PostgreSQL tutorial, postgresql tutorial
Obtain System Time Functions
select now(); --2013-11-28 16:20:25.259715+08select current_timestamp; --2013-11-28 16:20:38.815466+08select current_date; --2013
This article will introduce the usage of PostgreSQL time and date functions to you. For more information about how to use PostgreSQL time and date in SQL, refer to this tutorial.
1. Obtain System Time Functions
1.1 obtain the current full time
PostgreSQL date calculation functions, postgresql Functions
I. connector in each data
SqlServer connector: + (plus sign)
Sqlite connector:. (point)
PostgreSQL connector: | (OR)
II:
Today, when I was computing data in PostgreSQL, I had to record a
Unsolved. In the study
Solution:
Data Type problems:
Table 8-4. Character Type
Name
Description
Character varying (N), Varchar (N)
Variable Length with length restrictions
Character (N), Char (N)
Fixed Length, insufficient fill blank
Text
Variable
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.