SQLite Database 自定义函数实现:
//Here's how to create a function that finds the first character of a string. static void firstchar(sqlite3_context *context, int argc, sqlite3_value **argv) { if (argc == 1) { char *text = sqlite3_value_text(argv[0]); if (text && text[0]) { char result[2]; result[0] = text[0]; result[1] = '