SQLite²»Ö§³ÖµÄSQLÓï·¨×ܽá
1 TOP
ÕâÊÇÒ»¸ö´ó¼Ò¾³£Îʵ½µÄÎÊÌ⣬ÀýÈçÔÚSQLSERVERÖпÉÒÔʹÓÃÈçÏÂÓï¾äÀ´È¡µÃ¼Ç¼¼¯ÖеÄÇ°Ê®Ìõ¼Ç¼£º
SELECT TOP 10 * from [index] ORDER BY indexid DESC;
µ«ÊÇÕâÌõSQLÓï¾äÔÚSQLiteÖÐÊÇÎÞ·¨Ö´Ðеģ¬Ó¦¸Ã¸ÄΪ£º
SELECT * from [index] ORDER BY indexid DESC limit 0,10;
ÆäÖÐlimit 0,10±íʾ´ÓµÚ0Ìõ¼Ç¼¿ªÊ¼£¬ÍùºóÒ»¹²¶ÁÈ¡10Ìõ
2 ´´½¨ÊÓͼ£¨Create View£©
SQLiteÔÚ´´½¨¶à±íÊÓͼµÄʱºòÓÐÒ»¸öBUG£¬ÎÊÌâÈçÏ£º
CREATE VIEW watch_single AS SELECT
DISTINCTwatch_item.[watchid],watch_item.[itemid] from watch_item;
ÉÏÃæÕâÌõSQLÓï¾äÖ´Ðкó»áÏÔʾ³É¹¦£¬µ«ÊÇʵ¼ÊÉϳýÁË
SELECT COUNT(*) from [watch_single ] WHERE watch_ single.watchid = 1;
ÄÜÖ´ÐÐÖ®ÍâÊÇÎÞ·¨Ö´ÐÐÆäËûÈκÎÓï¾äµÄ¡£ÆäÔÒòÔÚÓÚ½¨Á¢ÊÓͼµÄʱºòÖ¸¶¨ÁË×Ö¶ÎËùÔڵıíÃû£¬¶øSQLite²¢²»ÄÜÕýÈ·µØʶ±ðËü¡£ËùÒÔÉÏÃæµÄ´´½¨Óï¾äÒª¸ÄΪ£º
CREATE VIEW watch_single AS SELECT DISTINCT [watchid],[itemid] from
watch_item;
µ«ÊÇËæÖ®¶øÀ´µÄÎÊÌâÊÇÈç¹ûÊǶà±íµÄÊÓͼ£¬ÇÒ±í¼äÓÐÖØÃû×ֶεÄʱºò¸ÃÔõô°ì£¿
3 COUNT£¨DISTINCT column£©
SQLiteÔÚÖ´ÐÐÈçÏÂÓï¾äµÄʱºò»á±¨´í£º
SELECT COUNT(DISTINCT watchid) from [watch_item] WHERE
watch_item.watchid = 1;
ÆäÔÒòÊÇSQLiteµÄËùÓÐÄÚÖú¯Êý¶¼²»Ö§³ÖDISTINCTÏÞ¶¨£¬ËùÒÔÈç¹ûҪͳ¼Æ²»Öظ´µÄ¼Ç¼ÊýµÄʱºò»á³öÏÖһЩÂé·³¡£±È½Ï¿ÉÐеÄ×ö·¨ÊÇÏȽ¨Á¢Ò»¸ö²»ÖØ
¸´µÄ¼Ç¼±íµÄÊÓͼ£¬È»ºóÔÙ¶Ô¸ÃÊÓͼ½øÐмÆÊý¡£
4 ÍâÁ¬½Ó
ËäÈ»SQLite¹Ù·½ÒѾÉù³ÆLEFT OUTER JOIN ÒѾʵÏÖ£¬µ«»¹Ã»ÓÐ RIGHT OUTER JOIN ºÍ FULL OUTER
JOIN¡£µ«ÊÇʵ¼Ê²âÊÔ±íÃ÷Ëƺõ²¢²»Äܹ»Õý³£µÄ¹¤×÷¡£ÒÔÏÂÈýÌõÓï¾äÔÚÖ´ÐеÄʱºò¾ù»á±¨´í£º
SELECT tags.[tagid] from [tags],[tag_rss] WHERE tags.[tagid] =
tag_rss.[tagid](*);
SELECT tags.[tagid] from [tags],[tag_rss] WHERE LEFT OUTER JOIN
tag_rss.[tagid] = tags.[tagid];
SELECT tags.[tagid] from [tags],[tag_rss] WHERE LEFT JOIN
tag_rss.[tagid] = tags.[tagid];
´ËÍâ¾¹ý²âÊÔÓÃ+ºÅ´úÌæ*ºÅÒ²ÊDz»¿ÉÐеġ£
ÊÕ¼¯SQLiteÓëSql ServerµÄÓï·¨²îÒì
1.·µ»Ø×îºó²åÈëµÄ±êʶֵ
·µ»Ø×îºó²åÈëµÄ±êʶֵsql serverÓÃ@@IDENTITY
sqliteÓñêÁ¿º¯ÊýLAST_INSERT_ROWID()
·µ»Øͨ¹ýµ±Ç°µÄ SQLConnection ²åÈëµ½Êý¾Ý¿âµÄ×îºóÒ»ÐеÄÐбêʶ·û£¨Éú³ÉµÄÖ÷¼ü£©¡£´ËÖµÓë
SQLConnection.lastInsertRowID ÊôÐÔ·µ»ØµÄÖµÏ
Ïà¹ØÎĵµ£º
±íרÇø
--
¸´ÖÆ±í¼°Êý¾Ý£¨´Ó
userinfo
±í¸´ÖƵ½Ð±í
b
select
*
into
b
from
UserInfo
--
»ñÈ¡µ±Ç°Êý¾Ý¿âÖеÄËùÓÐÓû§±í
select * from sysobjects where xtype='U' and category=0
--
»ñȡijһ¸ö±íµÄËùÓÐ×Ö¶Î
......
¸½:Oracle SQL Developer — À©Õ¹½»Á÷ÖÐÐÄ
http://www.oracle.com/technology/global/cn/products/database/sql_developer/files/extensions.htm
֮ǰ×÷Ϊһ¸öOracle Employee£¬È´×ÜÊÇÔÚʹÓÃPL/SQL Developer£¨¶øÇÒÊÇÆƽâ°æ£©£¬ÕâʵÔÚÓÐЩ˵²»¹ýÈ¥£¬µ«ÊÇÈçºÎÕÒµ½Ò»¸öºÏÐijÃÊÖµÄÄܹ»Ô ......
¿´µ½µÄһƪ¹ØÓÚÊý¾Ý¿âÓÅ»¯µÄÎÄÕ£¬¾õµÃ¶Ô×Ô¼ºÓаïÖú£¬¾ÍתÌûµ½ÕâÀιʶø֪У¡
ÓÅ»¯Êý¾Ý¿âµÄ˼Ïë¼°SQLÓï¾äÓÅ»¯µÄÔÔò [תÌù 2005-08-18 14:20:05 ] ·¢±íÕß: chilizy
......
1¡¢µ½Î¢Èí¹Ù·½È¥ÏÂÔØеÄÇý¶¯£¬ÏÂÔصØÖ·ÈçÏ£º
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
¡¡¡¡¹Ù·½ÎĵµÓÐÃèÊö£º
¡¡¡¡Refer to the documentation that is installed with the driver for a description of the new features in this ......
ʹÓùýSQL ServerµÄÈËÓ¦¸Ã¶¼Çå³þ£¬SQL Server³£ÓõÄÓÐÁ½ÖÖÈÏÖ¤·½Ê½£¬Ò»ÖÖÊDZ¾µØϵͳÕË»§ÈÏÖ¤£¨Windows Authentication £©£¬Ò»ÖÖÊÇʹÓÃÓû§ÃûºÍÃÜÂ루SQL Server Authentication £©£¬µÚ¶þÖÖÈÏÖ¤·½Ê½±ØÐëÆôÓÃSQL ServerµÄ»ìºÏģʽ¡£
¡¡¡¡1.Windows AuthenticationÁ¬½Ó²¿·Ö´úÂë¶Î£º
<?php
$serverName = "(local)";
$co ......