ÇóÌõsqlÓï¾ä,SQLÃæÊÔÌâÄ¿£¬
--ÇóÌõsqlÓï¾ä£º
-- ÒªÇó£º1.°´ÕÕGroup_OutDate×Ö¶ÎÅÅÐò £¬µÃµ½Ç°5Ìõ¼Ç¼
-- 2.Group_Name×ֶεÄÖµ²»ÄÜÖظ´
SELECT TOP 5 * from
( SELECT DISTINCT Group_Name ,
(SELECT TOP 1 Group_ID from AA_Sell_Group AS b WHERE b.Group_Name=a.Group_Name)
AS Group_ID from dbo.AA_Sell_Group AS a) AS ff --²»Öظ´µÄÊý¾Ý
JOIN AA_Sell_Group AS cc
ON ff.Group_ID = cc.Group_ID
ORDER BY cc.Group_OutDate DESC --ʱ¼äÅÅÐò
--ok
Ïà¹ØÎĵµ£º
1 £¬¶ÔÓÚÈÕÆÚ×Ö¶Î×Ö¶Î
access±íʾΪ£º#1981-28-12#
SQLSERVER2000±íʾΪ£º''1981-02-12''
2,SQLÓï¾äÇø±ð£¬select ,update ÔÚ¶Ôµ¥±í²Ù×÷ʱ¶¼²î²»¶à£¬
µ«¶à±í²Ù×÷ʱupdateÓï¾äµÄÇø±ðACCESSÓëSQLSERVERÖеÄUpdateÓï¾ä¶Ô±È:
SQLSERVERÖиüжà±íµÄUpdateÓï¾ä:
Update Tab1
SET a.Name = b.Name
from Tab1 a,Tab2 b
Whe ......
1.´ò¿ªSQL server enterprise mananger “ÆóÒµ¹ÜÀíÆ÷”
ÔÚÄãÒªµ¼³öµÄSQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý
2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£
3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍÎ ......
½ñÌìÓÖ¿´µ½Ð¼ÓƵÄͬÊ·¢¹ýÀ´µÄÒ»¶ÎSQLÓï¾ä£¬»¹ÊÇÀÏÎÊÌ⣬ʱ¼ä¶Ô±ÈÖ±½ÓÓôóÓÚСÓںš£Ì¾ÁËÉùÆøºó£¬ÊÖ¶¯¸ø¸Ä³ÉdatediffÁË£¬¿ÉÊÇÒ»ÔËÐгö´í£¬´íÎóÌáʾÈçÏ£º
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
ΪÁË˵Ã÷·½±ã£¬ÕâÀï¾Í¼ò»¯Ò»¸öÀý×ÓºÃÁË¡£
create tab ......
ÔÚÄÔ×ÓÀïÀÏÊǼǵõ±³õдSQLµÄʱºò£¬×ÜÊÇÓÐÈËÌáÐѶÔÓÚÖ÷¼üµÄÌõ¼þҪдÔÚÇ°Ã棬ÖÁÓÚΪʲôÏÖÔÚ×ÜÊǼDz»Çå³þÁË¡£µ«ÊÇSQLÖÐwhere Ìõ¼þµÄÖ´ÐÐ˳Ðò¸úÖ÷¼üÒÔ¼°Ë÷ÒýÓкܴóµÄ¹Øϵ¡£
°ÑÉÏƬÖеıía ¼ÓÉÏÖ÷¼ü£º
alter table
add constraint pk_a_id primary key (id)
È»ºóÔÚÔËÐÐÉÏƪÖгö´íµÄÀý¾ä:
select * from a where id in (1 ......