TIME WITH TIME ZONE the_time_with_zone AT TIME ZONE zone: the input time is adjusted to the new zone. TIMESTAMP WITH TIME ZONE the_timestamp_with_zone AT TIME ZONE zone: the input timestamp is adjusted to the new zone. TIMESTAMP WITHOUT TIME ZONE the_timestamp AT TIME ZONE zone: the_timestamp is understood to be in the default (UTC-7) time zone, then be adjusted to the new zone. JUSTIFY_INTERVAL(interval): apply JUSTIFY_DAYS and JUSTIFY_HOURS. JUSTIFY_HOURS(interval): adjust the interval so that 24-hour is represented by a day. JUSTIFY_DAYS(interval): adjust the interval so that 30-day is represented by a month. Format DatetimeĪGE(timestamp_1, timestamp_2): the interval between 2 timestamps (timestamp_1 – timestamp_2).ĪGE(timestamp): the interval between the current time and the input timestamp.ĭATE_TRUNC(field, timestamp): truncate the timestamp to the specified precision. TIMEOFDAY(): same as CLOCK_TIMESTAMP() but as a string. LOCALTIMESTAMP: (at the start of the current transaction). LOCALTIME: (at the start of the current transaction). STATEMENT_TIMESTAMP(): return current Datetime (at the start of the current statement).ĬLOCK_TIMESTAMP(): return current Datetime (may change during statement execution). REGEXP_REPLACE(s, p, to_s ): return s with POSIX pattern p replaced by to_s.ĭate – Time – Timestamp Get current DatetimeĬURRENT_DATE: current date (at the start of the current transaction).ĬURRENT_TIME: current time (at the start of the current transaction).ĬURRENT_TIMESTAMP / NOW() / TRANSACTION_TIMESTAMP(): return current Datetime (at the start of the current transaction). REGEXP_MATCHES(s, p ): return any occurrences of POSIX pattern p in the string s. SUBSTRING(s, pos) / SUBSTRING(s FROM pos): substring of s from pos position till the end. RIGHT(s, len): the last len characters of s. POSITION(substr IN s): the position of substr in s. MID(s, pos, len) / SUBSTRING(s, pos, len) / SUBSTRING(s FROM pos FOR len): from the position pos of s, take len characters. LEFT(s, len): the first len characters of s. REPLACE(s, from_s, to_s): replace all from_s of s to to_s. If the length of s is bigger than len, return the first len characters of s. RPAD(s, len, s_pad): if the length of s is smaller than len, the function returns s with the string s_pad padded on the right until its length equal to len. LPAD(s, len, s_pad): if the length of s is smaller than len, the function returns s with the string s_pad padded on the left until its length equal to len. TRIM( rem_s FROM s): trim all rem_s from s at both ends or on the left or on the right. TRIM(s): s will all spaces at both ends removed. RTRIM(s): s with all spaces on the right removed. LTRIM(s): s with all spaces on the left removed. with separator.ĬONCAT(s1, s2, s3, …): concatenate s1, s2, s3, etc. ConcatenateĬONCAT_WS(separator, s1, s2, s3, …): concatenate s1, s2, s3, etc. SIGN(x): return -1, 0 or 1 for negative, 0 and positive x, respectively.ĬHAR_LENGTH(s) / CHARACTER_LENGTH(s): length of s in characters. LEAST(x1, x2, x3, x4, …): return the smallest input. GREATEST(x1, x2, x3, x4, …): return the biggest input. RADIANS(x): convert x from degrees to radians. Angle functionsĭEGREES(x): convert x from radians to degrees. The output is confided in the range (, ). x must be in the range or else NULL is returned.ĪTAN2(y, x): the angle between the ray to point (x, y) and the positive x-axis. x must be in the range or else NULL is returned.ĪSIN(x): arc-sin(x). ROUND(x, d): the nearest number with d decimal places. CEIL(x) / CEILING(x): the smallest integer x.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |