[SQL 2000]·¢Éú´íÎó1069£ºÓÉÓڵǼʧ°Ü¶øÎÞ·¨Æô¶¯·þÎñ
ͬʱÆô¶¯ÆäËûsql ·þÎñ»á³öÏÖ ´íÎó1068:ÒÀ´æ·þÎñ»ò×éÎÞ·¨Æô¶¯£¨ÕâÊÇÓÉÓÚ¼¸¸öÏà¹ØÁªµÄ·þÎñÖÐÓÐÒ»¸ö²»ÄÜÆô¶¯£©¡£
´íÎó1069ÊÇÒ»¸öWindows NT/2000µÄϵͳ´íÎó¡£´íÎó1069±íÃ÷·þÎñ²»Äܱ»Æô¶¯£¨µ±Æô¶¯·þÎñʱ·µ»Ø“µÇ¼ʧ°Ü”´íÎ󣩡£ÀýÈ磬µ±Æô¶¯MSSQLServer·þÎñʱ£¬µÃµ½ÈçÏ´íÎóÌáʾ£º
·¢Éú´íÎó1069£ºÓÉÓڵǼʧ°Ü¶øÎÞ·¨Æô¶¯·þÎñ
´ËʱÕýÔÚMSSQLServer·þÎñÉÏÖ´Ðи÷þÎñ²Ù×÷
Èç¹û·þÎñ±»Ò»¸öûÓГµÇ¼·þÎñ”ȨÏÞµÄÕÊ»§ËùÆô¶¯Ê±»á·¢Éú1069´íÎó¡£½â¾ö¸ÃÎÊÌâµÄ·½·¨ÊǸøÓè¸ÃÕÊ»§ÒÔ“µÇ¼·þÎñ”ȨÏÞ¡£
¾ßÌåµ½MSSQLServerµÄÎÊÌ⣬Èç¹ûÔÚ°²×°ÔÚWindows XPÉÏ°²×°SQL Server 2000¿ª·¢°æ£¬²¢Ñ¡ÔñÁËĬÈÏÉèÖ㨽öWindowsµÄÉí·ÝÑéÖ¤·½Ê½£¬Ä¬ÈÏʵÀý£¬ÓÃWindowsµÄAdministratorÓû§½øÐеݲװµÈ£©£¬Ò»°ã»á·¢ÉúÉÏÊöÎÊÌâ¡£½â¾öµÄ·½·¨»áÓкܶàÖÖ£¬µ«×î¼òµ¥µÄ·½·¨ÊÇ£º
ÒÀ´Î´ò¿ªWindows¿ØÖÆÃæ°æ->¹ÜÀí¹¤¾ß->·þÎñ->MSSQLSERVER->ÊôÐÔ->µÇ¼£¬½«µÇ¼Éí·Ý¸ÄΪ±¾µØϵͳÕÊ»§
Ïà¹ØÎĵµ£º
Distinct
SELECT DISTINCT "À¸Î»"
from "±í¸ñÃû"
Where
SELECT "À¸Î»"
from "±í¸ñÃû"
WHERE "condition"
And/Or
SELECT "À¸Î»"
from "±í¸ñÃû"
WHERE "¼òµ¥Ìõ¼þ"
{[AND|OR] "¼òµ¥Ìõ¼þ"}+
In
SELECT "À ......
ÒªÔÚSQL ServerÊý¾Ý¿âÖд洢m³²¢´òÓ¡³öÀ´, ·½·¨ÈçÏ£º
1£©½«Êý¾Ý¿âÖÐÏàÓ¦×ֶεÄÊý¾ÝÀàÐÍÉèΪnchar»ònvarcharÀàÐÍ¡£
2£©´ÓExcelÖеõ½m³£¬¸´ÖÆÕ³Ìùµ½½ÓÊÕÊý¾ÝµÄ¿Ø¼þÖУ¨TextBox¡¢DataGridViewµÈ£©¡£±£´æ¼´¿É¡£
×¢£º1£©nchar,nvarcharÓëchar,varcharµ ......
×î½ü×öÁ˼¸¸öССͳ¼ÆµÄ±¨±í½çÃ棬ÓÉÓÚ.net²»´øgroup by µÄ¹¦ÄÜ£¬Í³¼ÆÆðÀ´ÓÐʱºòÏ൱²»±ã£¬±ã³Ã×Å˯×ŵÄʱºòдÁËÒ»¸öÀàËƵķ½·¨¡£
Óв»×ãÖ®´¦»òÊÇÓиüºÃµÄ·½·¨»¹Íû´ó¼ÒÖ¸Õý¡£
ÖÁÓÚЧÂÊÈçºÎ£¿Î´Öª£¬ÒòΪ±¾È˵IJâÊÔÊý¾Ý¾ÍÊDZȽÏÉÙ¡£
/// <summary>
/// SQL Group by
/// </summary>
/// &l ......
http://xujunprogrammer.blog.hexun.com/8376520_d.html
SQL ServerÖÐÎÄ°æµÄĬÈϵÄÈÕÆÚ×Ö¶Îdatetime¸ñʽÊÇyyyy-mm-dd Thh:mm:ss.mmm
ÀýÈç:
select getdate()
2004-09-12 11:06:08.177
Õâ¶ÔÓÚÔÚÒª²»Í¬Êý¾Ý¿â¼äתÒÆÊý¾Ý»òÕßÏ°¹ßoracleÈÕÆÚ¸ñʽYYYY-MM-DD HH24:MI:SSµÄÈ˶àÉÙÓÐЩ²»·½±ã.
ÎÒÕûÀíÁËÒ»ÏÂSQL ServerÀïÃæ¿ÉÄ ......
´íÎóÈçÏ£º
Database character set (AL32UTF8) and Client character set (ZHS16GBK) are different.
Character set conversion may cause unexpected results.
Note: you can set the client character set through the NLS_LANG environment variable or the NLS_LANG registry key in
HKEY_LOCAL_MACHINE\SOFTWARE\ ......