--Greenwich Date TIME, 8 hours later than Beijing time select datetime (' Now ');--Greenwich DATE Select date (' Now ');--local time (' Now ', ' localtime ');-- Date Time Format Select Strftime ('%y-%m-%d%h:%m:%s ', ' Now ', ' localtime ');--Add 1 hours Select datetime (Date (' Now '), ' +1 Hour ');-- Plus 1 hours and 30 minutes Select datetime (Date (' Now '), ' +1 hour ', ' +30 minute ');--Last day of the month Select date (' Now ', ' localtime ', ' start of month ', ' +1 month ', '-1 day ');--1th Select date of the month (' Now ', ' localtime ', ' start of Month ');--Next month, number 1th, select Date (' Now ', ' localtime ', ' Start Of month ', ' +1 month ');--intercept the string (the 2nd parameter is the starting position from 1, and the 3rd position is the Intercept length): The result is 123select substr (' abc123 ', 4, 3);--Calculate length, result is 6select Length (' abc123 ');--Returns lowercase, uppercase, result abc,abcselect lower (' abc '), Upper (' abc ');--Rounding retains 2 decimal places select round (CAST (1 as Double)/ Cast (3 as Double), 2),--case when usage selectcase when cast (strftime ('%H ', ' Now ', ' localtime ') as int) >= 6 and cast (strftime ('%H ', ' Now ', ' localtime ') as Int. <=12 then ' AM ' when cast (strftime ('%H ', ' Now ', ' localtime ') as int) >12 and cast (St Rftime ('%H ', ' Now ', ' localtime ') as int) <=18 then ' the afternoon ' when cast (strftime ('%H ', 'Now ', ' localtime ') as int) >18 and cast (strftime ('%H ', ' Now ', ' localtime ') as int) <=23 and ' Night ' else ' early ' end;
Some function usages of sqlite