sqlite dinstincÎÊÌâ
ΪʲôÓÃselect name,distinct phone from phone_book¾Í˵Óï·¨´íÎó£¬
ÓÃselect distinct phone,name from phone_book¾Í¿ÉÒÔ£¿
ûÓÐΪʲô distinct ÊÇ select µÄÐÞÊηû£¬Ö»ÄÜÔÚ select ºóÖ±½Óд distinct
Èç¹ûÎÒÏëµÃµ½µÄ½á¹ûÊÇname²»Öظ´»òphone²»Öظ´¸ÃÔõô°ì£¿ÄѵÀ²»Ö§³Ö£¿
û¿´Ã÷°×£¬½¨ÒéÄã¾ÙÀý˵Ã÷¡£
Ïà¹ØÎÊ´ð£º
SQLITEÏÂÈçºÎɾ³ýÄÚÈÝÖеĵÚÒ»¸ö<br>
SQLITEϲ»ºÃÓÃ
Ìáʾ:
sqlite error
no such function: stuff
Ôõô½â¾ö?
SQL code:
--------------------------------------------- ......
»·¾³£ºQNX 6.3.2
°æ±¾£ºSQLite 2.7.3
ÏÖÏó£ºÔÚÃüÁîÐÐÏÂsqlite½øÈ¥£¬Ö´ÐÐ.table¡¢pragmaÖ®Àà¡¢select¶¼Ìáʾ
database is locked
Ææ¹ÖµÄÊÇ£¬¼´Ê¹ÊÇд´½¨Ò»¸öÊý¾Ý¿â£¬Ö´ÐÐÉÏÊöÃüÁîÒ²ÊÇÄÇÑù¡£
Áí£ºÔÚһ̨Íê ......
ÎÒÏëÒª½«sqliteÊý¾Ý¿âÖеÄÊý¾Ý£¬ÒÔÊ÷¿Ø¼þµÄÐÎʽ¶Á³ö£¬²¢ÇÒÏÔʾÔÚ¶Ô»°¿òÉÏÃ棬²»ÖªµÀÔõô×ö£¬À´Çë½Ìһϡ£
ps£º¿´µ½ÓÐʹÓÃÊ÷¿Ø¼þºÍaccessµÄ£¬ÀïÃæÓÐÊý¾Ý¿âÒýÇæÀ´Á¬½ÓÊý¾Ý¿âºÍ³ÌÐò£¬ÎÒ²»ÖªµÀSQLiteÈçºÎÓë³ÌÐòÁ¬½ÓÆð ......
ÎÒÒª°ÑÊý¾Ý±íÖеÄÊý¾Ý£¬ÒÔÊ÷µÄÐÎʽÏÔʾÔÚ¶Ô»°¿òÖС£
±ÈÈ磺
Ö»ÒªÊý¾Ý±íÖÐÓÐ3¸ö×ֶΡ¢id¡¢parentid¡¢name
ÇëÎÊÎÒÈçºÎдһЩ´úÂ뽫Êý¾Ý±íÖеÄÄÚÈÝÌîµ½Ê÷¿Ø¼þÖÐÈ¥
ÒýÓÃ
Ò»°ãÊÇÓõݹéµÄ·½·¨À´ÊµÏ ......
sqlite ÖÐ
CREATE TABLE table1 (
id integer primary key autoincrement,
name text default '',
[index] integer default ROWID
)
ÓÐûÓÐÀàËƵŦÄÜ£¬Èà index µÄֵĬÈϵÈÓÚid£¬ ......