嵌入式數(shù)據(jù)庫(kù)是什么
時(shí)間:2018-03-08作者:華清遠(yuǎn)見(jiàn)
SQLite,是一款輕型的數(shù)據(jù)庫(kù),其設(shè)計(jì)目標(biāo)是嵌入式的數(shù)據(jù)庫(kù),而且當(dāng)前在很多嵌入式產(chǎn)品中使用到了sqlite數(shù)據(jù)庫(kù),sqlite數(shù)據(jù)庫(kù)占用資源非常的低,對(duì)嵌入式設(shè)備而言,內(nèi)存是非常寶貴的,而sqlite數(shù)據(jù)庫(kù)可能只需要幾百K的內(nèi)存就夠了。 Sqlite數(shù)據(jù)庫(kù)還能夠支持Windows/Linux/Unix等等主流的操作系統(tǒng),其跨平臺(tái)的可移植性特別強(qiáng),這極大的拓展了其生存的空間。 同時(shí)能夠跟很多程序語(yǔ)言相結(jié)合,比如C#、PHP、Java,C等,還有ODBC接口,同樣比起Mysql、PostgreSQL這兩款開(kāi)源的世界著名數(shù)據(jù)庫(kù)管理系統(tǒng)來(lái)講,它的處理速度比他們都快,比起Oracle數(shù)據(jù)庫(kù)來(lái)說(shuō),免費(fèi)也是極大的優(yōu)勢(shì)。 SQLite第一個(gè)Alpha版本誕生于2000年5月,至2018年已經(jīng)有18個(gè)年頭, SQLite 3也已經(jīng)發(fā)布,并成功的進(jìn)入了我們的事業(yè)。 除了上面提到的低內(nèi)存占用率、跨平臺(tái)可移植性、多語(yǔ)言支持、免費(fèi)開(kāi)源,sqlite3數(shù)據(jù)庫(kù)還有強(qiáng)大的功能,比如支持?jǐn)?shù)據(jù)庫(kù)大小可達(dá)2TB,十多萬(wàn)行的代碼非常適合學(xué)習(xí),良好的代碼注釋等等。 那么我們學(xué)習(xí)數(shù)據(jù)庫(kù)最好可以快速的入門(mén),在門(mén)外徘徊太久的話會(huì)挫傷我們學(xué)習(xí)的積極性。如果你是一個(gè)嵌入式的學(xué)習(xí)和開(kāi)發(fā)者,那么從以下兩個(gè)方面出發(fā)可以幫你快速的上手sqlite3數(shù)據(jù)庫(kù): 1、Sqlite3的命令 :數(shù)據(jù)庫(kù)的創(chuàng)建及增刪改查 2、2、sqlite3 API函數(shù)接口:用API接口實(shí)現(xiàn)數(shù)據(jù)庫(kù)的創(chuàng)建及增刪改查 當(dāng)然了,以下是基于Ubuntu平臺(tái)做的測(cè)試: 1-- 安裝數(shù)據(jù)庫(kù): 在線安裝:sudo apt-get install sqlite sqlite3 sudo apt-get install libsqlite3-dev sudo apt-get install sqlitebrowser 離線安裝: 下載安裝下面三個(gè)包: libsqlite3-0_3.7.2-1ubuntu0.1_i386.deb libsqlite3-dev_3.7.2-1ubuntu0.1_i386.deb sqlite3_3.7.2-1ubuntu0.1_i386.deb sudo dpkg -i *.deb (數(shù)據(jù)庫(kù)安裝文件) 2、Sqlite3的命令 2.1、創(chuàng)建數(shù)據(jù)庫(kù) sqlite3 stu.db 必須指定數(shù)據(jù)庫(kù)名字 2.2、sqlite命令 系統(tǒng)命令 以 "."開(kāi)頭 普通命令 ,以";"結(jié)束 .schema 查看表的結(jié)構(gòu) .quit 退出數(shù)據(jù)庫(kù) .exit 退出數(shù)據(jù)庫(kù) .help 查看幫助信息 .databases 查看數(shù)據(jù)庫(kù) .tables 顯示數(shù)據(jù)庫(kù)中所有的表的表名 2.3、sqlite3 的使用 : 增刪改查 1-- 創(chuàng)建一張表 create table 表名(字段名稱1 字段類型,字段名稱2 字段類型, ....); create table stu(id int, name char, sex char , score int); 2-- 向表中插入一條記錄 insert into 表名 values (字段值1,字段值2,...); insert into stu values(1001, 'zhangsan', 'm', 89); insert into stu (id, name, sex,score) values(1002, 'lisi', 'm', 99); 3-- 查詢記錄 select * from stu; // 查找所有的記錄 select * from stu where id=1001; // 查找符號(hào)條件的記錄 select * from stu where id=1001 and name='zhangsan'; // 字符串需要加引號(hào) select * from stu where name = 'zhangsan' or score=92; 4-- 刪除記錄 delete from stu where id=1004; 5-- 更新記錄 update stu set score=98 where id=1003; 6-- 刪除一張表 drop table stu; 7-- 添加一列 alter table stu add column score int; 8-- 刪除一列 sqlite3 不允許直接刪除一列 1)先創(chuàng)建一張新表 create table stu1 as select id , name from stu; 2)刪除原來(lái)的舊表 drop table stu; 3)對(duì)新表重命名 alter table stu1 rename to stu; 9-- 數(shù)據(jù)庫(kù)主鍵(既設(shè)置的數(shù)據(jù)將會(huì)是唯一存在的) create table usr(name text primary key , passwd text); 3、sqlite3 API 函數(shù)接口: 學(xué)習(xí)API函數(shù)接口,那么首先要掌握函數(shù)接口的三要素: 功能--參數(shù)--返回值, 然后就是寫(xiě)代碼去驗(yàn)證我們隊(duì)函數(shù)的理解,然后將函數(shù)用到實(shí)際的項(xiàng)目開(kāi)發(fā)當(dāng)中 (1)int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb /* OUT: SQLite db handle */ ); 功能:打開(kāi)一個(gè)數(shù)據(jù)庫(kù) 參數(shù):filename 數(shù)據(jù)庫(kù)名字 ppdb 操作數(shù)據(jù)庫(kù)的指針,句柄。 返回值:成功 SQLITE_OK , 失敗 error_code (2)const char *sqlite3_errmsg(sqlite3* db); 功能:獲取錯(cuò)誤信息描述 (3)int sqlite3_close(sqlite3* db); 功能:關(guān)閉一個(gè)數(shù)據(jù)庫(kù) (4)int sqlite3_exec( sqlite3* db, /* An open database */ const char *sql, /* SQL to be evaluated */ int (*callback)(void*,int,char**,char**), /* Callback function */ void * arg, /* 1st argument to callback */ char **errmsg /* Error msg written here */ ); 功能:執(zhí)行一條sql語(yǔ)句 參數(shù):db 數(shù)據(jù)庫(kù)的句柄指針 sql 將要被執(zhí)行sql語(yǔ)句 callback 回調(diào)函數(shù), 只有在查詢語(yǔ)句時(shí),才給回調(diào)函數(shù)傳參 arg 為callback 傳參的 errmsg 錯(cuò)誤信息的地址 返回值:成功 SQLITE_OK 出錯(cuò) errcode 錯(cuò)誤碼 int (*callback)(void* arg ,int ncolumn ,char** f_value,char** f_name) 功能:得到查詢結(jié)果 參數(shù):arg 為回調(diào)函數(shù)傳遞參數(shù)使用的 ncolumn 記錄中包含的字段的數(shù)目 f_value 包含每個(gè)字段值的指針數(shù)組 f_name 包含每個(gè)字段名稱的指針數(shù)組 返回值:成功 0,出錯(cuò) 非0 (5)int sqlite3_get_table( sqlite3 *db, /* An open database */ const char *zSql, /* SQL to be evaluated */ char ***pazResult, /* Results of the query */ int *pnRow, /* Number of result rows written here */ int *pnColumn, /* Number of result columns written here */ char **pzErrmsg /* Error msg written here */ ); 功能:查詢數(shù)據(jù)庫(kù),它會(huì)創(chuàng)建一個(gè)新的內(nèi)存區(qū)域來(lái)存放查詢的結(jié)果信息 參數(shù):db 數(shù)據(jù)庫(kù)操作句柄 sql 數(shù)據(jù)庫(kù)的sql語(yǔ)句 azResult 查詢的結(jié)果 nRow 行數(shù) nColumn 列數(shù) errmsg 錯(cuò)誤消息 返回值: 成功 0 出錯(cuò) errcode nrow的值為查詢到的符合條件的記錄數(shù)(不包括字段名)。 ncolumn的值為查詢到的符合條件的字段數(shù)。 注意:nrow的值不包括字段名,如果打印時(shí)用for (i = 0; i < nrow; i++)會(huì)打印出字段名,但是會(huì)少打印出一條符合條件的記錄。 因此打印時(shí)要用 for (i = 0; i (6)void sqlite3_free_table(char **result); 功能:釋放內(nèi)存 4、下面我們先來(lái)測(cè)一下sqlite命令的使用: fengjunhui@ubuntu:~/Sqlite$ sqlite3 fengjunhui.db SQLite version 3.7.2 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table stu(id int,name char,sex char,score int); sqlite> insert into stu values(1001,'fengjunhui','m',88); 1001|fengjunhui|m|88 1002|liuxiaofan|m|92 1003|luzhengyu|m|96 1004|xiaohui|m|86 sqlite> select * from stu where name=fengjunhui ; Error: no such column: fengjunhui ----注意類型匹配 sqlite> select * from stu where name = 'fengjunhui'; 1001|fengjunhui|m|88 sqlite> select * from stu where id=1003; 1003|luzhengyu|m|96 sqlite> update stu set sex = f where id=1002; Error: no such column: f sqlite> update stu set sex ='f' where id=1002; sqlite> select * from stu ...> ; 1001|fengjunhui|m|88 1002|liuxiaofan|f|92 1003|luzhengyu|m|96 1004|xiaohui|m|86 sqlite> delete from stu where name='xiaohui'; sqlite> select * from stu; 1001|fengjunhui|m|88 1002|liuxiaofan|f|92 1003|luzhengyu|m|96 sqlite> alter table stu add column age int; sqlite> select * from stu ; 1001|fengjunhui|m|88| 1002|liuxiaofan|f|92| 1003|luzhengyu|m|96| sqlite> update stu set age = 25 where id=1001; sqlite> select * from stu; 1001|fengjunhui|m|88|25 1002|liuxiaofan|f|92| 1003|luzhengyu|m|96| sqlite> create table stu_bak as select id,name,sex,score from stu; sqlite> .table stu stu_bak sqlite> .schema CREATE TABLE stu(id int,name char,sex char,score int, age int); CREATE TABLE stu_bak( id INT, name TEXT, sex TEXT, score INT ); sqlite> drop table stu; sqlite> alter table stu_bak rename to stu; sqlite> .table stu sqlite> create table usr(name text primary key,passwd text); sqlite> .talbe Error: unknown command or invalid arguments: "talbe". Enter ".help" for help sqlite> .table stu usr 5、sqlite3 API函數(shù)接口的使用 測(cè)試源碼:
#include
#include //注意:編譯時(shí)需要手動(dòng)鏈接庫(kù)文件 -lsqlite3 #define DATABASE "student.db" #define N 128 #define IS_NUM(index) (0 <= index && index <= 9) ? 1 : 0 int flags = 0; int do_insert(sqlite3 *db) { int id; char name[N]; int score; char sql[N]; char *errmsg; printf("please input id >>> "); scanf("%d", &id); getchar(); printf("please input name >>> "); scanf("%s", name); getchar(); printf("please input score >>> "); scanf("%d", &score); getchar(); sprintf(sql, "insert into stu values(%d, '%s', %d)", id, name, score); if(sqlite3_exec(db, sql, NULL, NULL, &errmsg) != SQLITE_OK) { printf("%s\n", errmsg); } else { printf("the datas is inserted successfully\n"); } return 0; } //回調(diào)函數(shù)負(fù)責(zé)得到查詢的結(jié)果 int callback(void *arg, int ncolumn, char **f_value, char **f_name) { int i = 0; if(flags == 0) { for(i = 0; i < ncolumn; i++) { printf("%-11s", f_name[i]); } putchar(10); flags = 1; } for(i = 0; i < ncolumn; i++) { printf("%-11s", f_value[i]); } putchar(10); return 0; } //查詢數(shù)據(jù) int do_select(sqlite3 *db) { char *errmsg; if(sqlite3_exec(db, "select * from stu", callback, NULL, &errmsg) != SQLITE_OK){ printf("%s\n", errmsg); }else{ printf("the datas is selected successfully\n"); } return 0; } int do_update(sqlite3* db) { int id,score; char name[N]={0},columnname[N]={0},columntype[N]={0}; int num,index; char* errmsg; char sql[N]={0}; printf("input your index for search: 1 id 2 name 3 score: \n"); scanf("%d",&index); getchar(); if(index == 1){ printf("input id : \n"); scanf("%d",&id); }else if(index == 2){ printf("input name : \n"); scanf("%s",name); }else { printf("input score: \n"); scanf("%d",&score); } printf("your choice whose info to update: 1 id 2 name 3 score 4 colum: \n"); scanf("%d",&num); getchar(); switch(num) { case 1: printf("please input id: "); scanf("%d",&id); getchar(); if(index == 1){ printf("input sorry,the same info,no need change.\n "); }else if(index == 2){ sprintf(sql,"update stu set id=%d where name='%s'",id,name); }else if(index == 3){ sprintf(sql,"update stu set id=%d where score=%d",id,score); }if(sqlite3_exec(db,sql,NULL,NULL,&errmsg) != SQLITE_OK){ printf("%s\n",errmsg); } break; case 2: printf("please input name: "); scanf("%s",name); getchar(); if(index == 1){ sprintf(sql,"update stu set name=%s where id='%d'",name,id); }if(index == 2){ printf("input sorry,the same info,no need change.\n "); }else if(index == 3){ sprintf(sql,"update stu set name=%s where score=%d",name,score); }if(sqlite3_exec(db,sql,NULL,NULL,&errmsg) != SQLITE_OK){ printf("%s\n",errmsg); } break; case 3: printf("please input socre: "); scanf("%d",&score); getchar(); if(index == 1) { sprintf(sql,"update stu set score=%d where id='%d'",score,id); }else if(index == 2){ sprintf(sql,"update stu set score=%d where name=%s",score,name); } else if(index == 3){ printf("input sorry,the same info,no need change.\n "); } if(sqlite3_exec(db,sql,NULL,NULL,&errmsg) != SQLITE_OK){ printf("%s\n",errmsg); } break; case 4: printf("please input column name: "); scanf("%s",columnname); getchar(); printf("please input column type: INT or CHAR"); scanf("%s",columntype); getchar(); sprintf(sql,"alter table stu add column '%s' '%s' '",columnname,columntype); if(sqlite3_exec(db,sql,NULL,NULL,&errmsg) != SQLITE_OK){ printf("%s\n",errmsg); } break; default: printf("input illegal.\n"); } printf("the datas is update successfully\n"); return 0; } int do_delete(sqlite3* db) { int i=0; char table[N]={0}; int id,score,index; char name[N]={0}; char* errmsg; char sql[N]={0}; char *delsql[5]={0}; printf("\n"); do_select(db); //printf database info list printf("\n"); printf("input index for delete: 1 id 2 name 3 score 4 table 5 colum: \n"); scanf("%d",&index); getchar(); if(index == 1){ printf("input id : \n"); scanf("%d",&id); sprintf(sql,"delete from stu where id=%d",id); }else if(index == 2){ printf("input name : \n"); scanf("%s",name); sprintf(sql,"delete from stu where name=%s",name); }else if(index == 3){ printf("input score: \n"); scanf("%d",&score); sprintf(sql,"delete from stu where score=%d",score); }else if(index == 4){ printf("input which table: \n"); scanf("%s",table); sprintf(sql,"drop table %s",table); }else if(index == 5){ #if 0 sprintf(delsql[0],"create table stu1 as select id,name from stu\n"); sprintf(delsql[1],"drop table stu\n"); sprintf(delsql[2],"alter table stu1 rename to stu\n"); #endif delsql[0] = "create table stu1 as select id,name from stu"; delsql[1] = "drop table stu"; delsql[2] = "alter table stu1 rename to stu"; for(i = 0;i < 3;i ++){ printf("delsql[%d]: %s\n",i,delsql[i]); } return 0; } if(sqlite3_exec(db,sql,NULL,NULL,&errmsg) != SQLITE_OK){ printf("%s\n",errmsg); } return 0; } int main(int argc, const char *argv[]) { sqlite3 *db; char *errmsg; int num; //創(chuàng)建(打開(kāi))數(shù)據(jù)庫(kù) if(sqlite3_open(DATABASE, &db) != SQLITE_OK) { printf("%s\n", sqlite3_errmsg(db)); }else{ printf("the database is opened successfully\n"); } //創(chuàng)建一張表 if(sqlite3_exec(db, "create table stu(id int, name char, score int)", NULL, NULL, &errmsg) != SQLITE_OK){ printf("%s\n", errmsg); }else { printf("the table is created successfully\n"); } //對(duì)當(dāng)前表進(jìn)行增刪改查 while(1) { printf("\n"); printf("***1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出***\n"); printf("\n"); printf(">>> "); scanf("%d", &num); getchar(); switch(num) { case 1: do_insert(db); break; case 2: flags = 0; do_select(db); //do_select_get_table(db); break; case 3: do_update(db); break; case 4: do_delete(db); break; case 5: sqlite3_close(db); return -1; default: printf("please input correct option\n"); } } return 0; } 測(cè)試結(jié)果: fengjunhui@ubuntu:~/Sqlite$ ./a.out the database is opened successfully table stu already exists 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 2 id name score 1001 liuxiaofan 92 1004 fengjunhui 98 1003 luzhengyu 96 the datas is selected successfully 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 1 please input id >>> 1005 please input name >>> xiaohuihui please input score >>> 76 the datas is inserted successfully 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 3 input your index for search: 1 id 2 name 3 score: 1 input id : 1004 your choice whose info to update: 1 id 2 name 3 score 4 colum: 3 please input socre: 88 the datas is update successfully 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 2 id name score 1001 liuxiaofan 92 1004 fengjunhui 88 1003 luzhengyu 96 1005 xiaohuihui 76 the datas is selected successfully 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 4 1001 liuxiaofan 92 1004 fengjunhui 88 1003 luzhengyu 96 1005 xiaohuihui 76 the datas is selected successfully input index for delete: 1 id 2 name 3 score 4 table 5 colum: 2 input name : fengjunhui no such column: fengjunhui 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 2 id name score 1001 liuxiaofan 92 1004 fengjunhui 88 1003 luzhengyu 96 1005 xiaohuihui 76 the datas is selected successfully 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 5 fengjunhui@ubuntu:~/Sqlite$ gcc 5_student.c -lsqlite3 fengjunhui@ubuntu:~/Sqlite$ ./a.out the database is opened successfully table stu already exists 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 4 id name score 1001 liuxiaofan 92 1004 fengjunhui 88 1003 luzhengyu 96 1005 xiaohuihui 76 the datas is selected successfully input index for delete: 1 id 2 name 3 score 4 table 5 colum: 2 input name : 'fengjunhui' 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 2 id name score 1001 liuxiaofan 92 1003 luzhengyu 96 1005 xiaohuihui 76 the datas is selected successfully 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 5 fengjunhui@ubuntu:~/Sqlite$ gcc 5_student.c -lsqlite3 fengjunhui@ubuntu:~/Sqlite$ ./a.out the database is opened successfully table stu already exists 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 4 id name score 1001 liuxiaofan 92 1003 luzhengyu 96 1005 xiaohuihui 76 the datas is selected successfully input index for delete: 1 id 2 name 3 score 4 table 5 colum: 5 delsql[0]: create table stu1 as select id,name from stu delsql[1]: drop table stu delsql[2]: alter table stu1 rename to stu 1:插入數(shù)據(jù) 2:查詢數(shù)據(jù) 3:修改數(shù)據(jù) 4:刪除數(shù)據(jù) 5:退出 >>> 5 擴(kuò)展內(nèi)容: sqlite3支持的數(shù)據(jù)類型: NULL、INTEGER、REAL、TEXT、BLOB 但是,sqlite3也支持如下的數(shù)據(jù)類型 smallint 16位整數(shù) integer 32位整數(shù) decimal(p,s) p是精確值,s是小數(shù)位數(shù) float 32位實(shí)數(shù) double 64位實(shí)數(shù) char(n) n長(zhǎng)度字符串,不能超過(guò)254 varchar(n) 長(zhǎng)度不固定最大字符串長(zhǎng)度為n,n不超過(guò)4000 graphic(n) 和 char(n) 一樣,但是單位是兩個(gè)字符double-bytes,n不超過(guò)127(中文字) vargraphic(n) 可變長(zhǎng)度且最大長(zhǎng)度為n date 包含了年份、月份、日期 time 包含了小時(shí)、分鐘、秒 timestamp 包含了年、月、日、時(shí)、分、秒、千分之一秒 sqlite3支持的函數(shù) 【1】日期函數(shù) datetime() : 產(chǎn)生日期和時(shí)間 date(): 產(chǎn)生日期 time():產(chǎn)生時(shí)間 strftime():對(duì)以上3個(gè)函數(shù)產(chǎn)生的日期和時(shí)間進(jìn)行格式化 用法實(shí)例: 1、select date('2011-9-9','+1 day','+1 year'); 結(jié)果是 2010-09-10 2、select datetime('now'); 當(dāng)前日期和時(shí)間 3、select datetime('now', 'start of month'); 本月的第一天零點(diǎn),也可以設(shè)置年和日的第一天 4、select datetime('now','+1 hour','-12 minute'); 當(dāng)前時(shí)間加48分鐘 strftime()函數(shù)可以將YYYY-MM-DD HH:MM:SS格式的日期字符串轉(zhuǎn)換為其它形式的字符串 %d:天數(shù),01-31 %f :小數(shù)形式的秒,SS.SSS %H:小時(shí) %j :某一天是該年的第幾天,001-366 %m:月份,00-12 %M:分鐘,00-59 %s:從1970到現(xiàn)在的秒數(shù) %S:秒,00-59 %w:星期,0-6,0是星期天 %W:某天是該年的第幾周,01-53 %Y:年,YYYY %% 百分號(hào) 應(yīng)用舉例: select strftime('%Y.%m.%d %H:%M:%S','now','localtime'); 二、【算術(shù)函數(shù)】 abs(X):返回絕對(duì)值 max(X,Y[,...]):返回最大值 min(X,Y,[,...]):返回最小值 random(*):返回隨機(jī)數(shù) round(X[,Y]): 四舍五入 三、【字符串處理函數(shù)】 length(x) :返回字符串字符個(gè)數(shù) lower(x) :大寫(xiě)轉(zhuǎn)小寫(xiě) upper(x):小寫(xiě)轉(zhuǎn)大寫(xiě) substr(x,y,Z):截取子串 like(A,B):確定給定的字符串與指定的模式是否匹配 相關(guān)資訊
發(fā)表評(píng)論
|
學(xué)院新動(dòng)態(tài)
嵌入式招聘熱門(mén)文章全國(guó)咨詢電話:400-611-6270,雙休日及節(jié)假日請(qǐng)致電值班手機(jī):15010390966
在線咨詢: 曹老師QQ(3337544669), 徐老師QQ(1462495461), 劉老師 QQ(3108687497)
企業(yè)培訓(xùn)洽談專線:010-82600901,院校合作洽談專線:010-82600350,在線咨詢:QQ(248856300)
Copyright 2004-2018 華清遠(yuǎn)見(jiàn)教育科技集團(tuán) 版權(quán)所有 ,京ICP備16055225號(hào),京公海網(wǎng)安備11010802025203號(hào)