MAX Function in SQLite

SQLite MAX Function To fetch the lowest value from an expression, the SQLite MAX function is used. Syntax 1: SELECT MAX(aggregate_expression) FROM tables WHERE conditions; Syntax 2: With GROUP BY clause SELECT expression1, expression2, … expression_n MAX(aggregate_expression) FROM tables WHERE conditions GROUP BY expressions; Example 1: TEACHERS Table: ID NAME SALARY SUBJECT 1 Jim 10000 … Read more

MIN() Function in SQLite

SQLite MIN Function To fetch the lowest value from an expression, the SQLite MIN function is used. Syntax 1: SELECT MIN(aggregate_expression) FROM tables WHERE conditions; Syntax 2: With GROUP BY clause SELECT expression1, expression2, … expression_n MIN(aggregate_expression) FROM tables WHERE conditions GROUP BY expressions; Example 1: TEACHERS Table: ID NAME SALARY SUBJECT 1 Jim 10000 … Read more

Aggregate Functions in SQLite

SQLite Aggregate Functions SQLite Aggregate functions are used to perform certain calculations on a numeric value, a string or the multiple rows of an SQLite table. Some of the SQLite Aggregate functions are:   FUNCTION USES MIN To select the lowest (minimum) value for a certain column. MAX To select the highest (maximum) value for … Read more

Time() Function in SQLite

SQLite Time Function To get a time value, the SQLite time function is used. It returns a time value in ‘HH-MM-SS’ format. Syntax: time( time_string, [ modifier1, modifier2, … modifier_n ] ) Time_string: TIMESTRING USES now To get the current date. YYYY-MM-DD To specify the date value formatted as ‘YYYY-MM-DD’. YYYY-MM-DD HH:MM To specify the … Read more

Date() Function in SQLite

SQLite Date Function To get a date value, the SQLite date function is used. It returns a date value in ‘YYYY-MM-DD’ format. Syntax: date( time_string, [ modifier1, modifier2, … modifier_n ] ) Time_string: TIMESTRING USES now To get the current date. YYYY-MM-DD To specify the date value formatted as ‘YYYY-MM-DD’. YYYY-MM-DD HH:MM To specify the … Read more

now() function in SQLite

SQLite now() Now” is a time string parameter in SQLite which is used to fetch the current date and time by various SQLite functions. Syntax 1: date(‘now’) Syntax 2: time(‘now’) Syntax 3: strftime( Syntax 4: strftime( Syntax 5: strftime( Format: FORMAT DESCRIPTION VALUES

strftime Function in SQLite

SQLite strftime Function To fetch date and time, the SQLite strftime function is used. It is a very powerful function and is also used to perform date calculations.   Syntax: strftime (format, timestring [, modifier1, modifier2, … modifier_n ] )   Format: FORMAT DESCRIPTION VALUES

Julianday Function in SQLite

SQLite Julianday Function To convert a date as a Julian Day the SQLite Julianday function is used. The resultant is thus a floating-point number. A Julian Day can be simply understood as the number of days since November 24, 4714 BC 12:00 pm Greenwich time in the Gregorian calendar. Syntax: julianday(timestring [, modifier1, modifier2, … … Read more

DateTime Function in SQLite

SQLite DateTime Function To retrieve date and time in different formats, the DateTime function is used in SQLite. The result format of DateTime function is ‘YYYY-MM-DD HH:MM:SS’. Syntax: datetime(timestring, [ modifier1, modifier2, … modifier_n ] ) Example 1: SELECT datetime(’now’);SELECT datetime(‘now’); Output: 2019-08-05 12:00:072019-08-05 12:00:07 Explanation: In the above example, we are retrieving the current … Read more

Date and Time() Functions in SQLite

To get the current date and time, the date and time() functions are used in SQLite. It uses a subset of IS0-8601 date and time formats.   FUNCTION USES SQLite date() function To calculate the date and return it in the format ‘YYYY-MM-DD’. SQLite datetime() function To calculate a date/time value, and return it in … Read more