Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mssqlÈ¥³ýÖظ´²¢ÅÅÐòµÄÎÊÌâ

SQL code:
/*
create database temp
use temp

create table employees
(
eID int identity primary key,
eName nvarchar(50) not null,
eSex smallint not null default(1),
eSort smallint default(0)
)

insert into employees values('a1',1,1);
insert into employees values('b5',0,5);
insert into employees values('a6',0,6);
insert into employees values('b3',1,3);

insert into employees values('a1',1,7);
insert into employees values('b5',0,9);
insert into employees values('a6',0,10);
insert into employees values('b3',1,20);
*/


ÏëµÃµ½ÕâôÑùµÄÒ»¸ö½á¹û£º£¨È¥³ýÖظ´µÄeName£¬²éѯ³öesort×î´óµÄ¼Ç¼¼¯£©
5 a1 1 7
6 b5 0 9
7 a6 0 10
8 b3 1 20

{{


Ïà¹ØÎÊ´ð£º

×ÜÕ¾·ÖÕ¾MSSQL¿â½á¹¹

Ò»¸ö×ÜÕ¾.Èý¸ö×ÓÕ¾¹²ËĸöASP¿ª·¢µÄÕ¾µã;Êý¾Ý¿âÊÇMSSQL2000;ËĸöÕ¾¸÷ÓÐ×Ô¼ºµÄÊý¾Ý¿â(ËĸöÕ¾µãµÄ¿â½á¹¹¶¼ÊÇÒ»ÑùµÄ.),¸÷ÓÐ×Ô¼ºµÄÐÅÏ¢Ìí¼Óºǫ́,ËĸöÕ¾ÊǶÀÁ¢µÄ.ËĸöÕ¾¶¼ÔÚͬһ¸ö·þÎñÆ÷ÖÐ.
ÏÖÔÚÐèÒªÏÖʵ:
Ò».ÈçºÎÈÃ×ÜÕ¾ ......

MSSQLÖÐÈçºÎÑ¡ÔñÒ»ÐÐÖÐ×îСµÄʱ¼ä£¿

Ò»ÕÅ±í£¬×ֶηÖΪid,time1,time2,time3,time4,time5 
ÇëÎÊÎÒÓ¦¸ÃÈçºÎÑ¡ÔñIDΪ1µÄÄÇÌõ¼Ç¼ÖÐtimeʱ¼ä×îСµÄÖµÄØ£¿
UP!

[code=SQL][/code]select min(t) from 
(select time1 as t from t1 where id ......

MSSQLµÄsqlÓï¾ä

ÎÒÔ­À´ÊÇÓÉaccessת³ÉmssqlµÄ..Ô­À´µÄ×ÔÔö×Ô¶¯Ã»ÓÐÁË
ÎÒÔõôÓÃsqlÀ´×ª»¯ÄØ£¿£¨²»ÏëÔÚÆóÒµÃæ°å¹ÜÀíÖÐ¸Ä ±íÌ«¶à..£©
»¹ÓÐsmalldateµÄĬÈÏÖµ¸Ä³Égetdate()µÄÓï¾äÒªÔõôд..ллÁË
accessת³ÉmssqlµÄ..Ô­À´µÄ×ÔÔö×Ô¶ ......

ÐÞ¸ÄmssqlÁеÄÃû³Æ

ÎÒÒª°Ñv10004¸Ä³ÉÃû×ÖÆøѹ£¬ÎªºÎ×ܳö´í
EXEC  sp_rename  'dbo,A0131.[v10004]',  'Æøѹ',  'COLUMN'

ÏûÏ¢ 15248£¬¼¶±ð 11£¬×´Ì¬ 1£¬¹ý³Ì sp_rename£¬µÚ ......

MSSQL´¥·¢Æ÷Ϊʲô×Ô¶¯É¾³ýÁË??????????

ÏÂÃæÊÇÎÒ´´½¨µÄÒ»¸ö´¥·¢Æ÷,µ±¹â·üµç³ØÊýÖµ³¬¹ýÉ趨µÄ·¶Î§¾Í»á²åÈë¹ÊÕϱí,
µ«ÊÇÔÚ¸Õ¸Õ½¨Á¢µÄ´¥·¢Æ÷ʱ,¿ÉÒÔ½«¹ÊÕÏÊý¾Ý²åÈëµ½¹ÊÕϱí,Ö®ºóÕâ¸ö´¥·¢Æ÷¾Í×Ô¶¯ÏûʧÁË.Ò²¾ÍÊÇ´´½¨¹ýºóÖ»ÔËÐÐÒ»´Î.
(Ææ¹ÖµÄÊÂ,ÎÒµÄÁíÒ»¸ö±íÓà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ