Sorry!
This article has not been translated yet.
Kirjoitettaessa sääntäjoukon poimintasääntöjä niin käytettävissä on SQL Liten toimintojen lisäksi palveluun toteutettuja apufunktioita. Apufunktioiden avulla on SQL Liteä helpompi käsitellä esimerkiksi merkkijonoja.
Luettelo käytettävissä olevista apufunktioista ja niiden toiminnasta
- substring_part. Parametrit: (sourceString, separator, index). Funkio jakaa annetun merkkijonon sourceString annetulla erotinmerkkijonolla separator. Paluuarvona muodostuu niin mones tietosisältö kuin index arvo osoittaa. Mikäli merkkijono ei sisällä tätä elementtiä niin palautetaan NULL. Negatiivinen index palauttaa indeksin osoittaman elementin laskettuna viimeisistä tuloksista. -1 palauttaa viimeisen elementin, -2 palauttaa toiseksi viimeisen ja niin edelleen.
- substring_index() https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_substring-index
- sql_left() https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_left
- sql_right() https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_right
- concat() https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_concat
- if() https://dev.mysql.com/doc/refman/8.0/en/control-flow-functions.html#function_if
- timestamp() https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_timestamp
- strftime(format,timestring) Returns the 'timestring' formatted according to the 'format' string provided. For example, strftime('%Y %m %d','now') would extract the Year Month and Day for the current date.
- curdate() Returns the current date according the server's local timezone (Finland). Format YYYY-MM-DD
- curtime() Returns the current time according to the server's local timezone (Finland). Format H:i:s
- now() Returns the current date and time according to the server's local timezone (Finland). Format YYYY-MM-DD HH:MM:SS
- weekday(date/datetime/timestamp) Returns the day of the week as a number based on the provided date or time. 0 (for Monday) through 6 (for Sunday)
- ceil(decimal) Round a decimal up to the nearest whole number
- floor(decimal) Round a decimal down to the nearest whole number