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

ÇóÖúsqlд·¨

¸÷λ´óÏÀ£¬ÇóÖúsql
Ô­±í
A    B        time
A1  down      10:01
A1  up        10:02
A1  down      10:25
A1  up        10:35
A2  down      10:36
A2  up        10:55

Ï£ÍûµÃ³öij¸öAÏîÿ´Îdown ºÍupµÄʱ¼ä

A  time1      time2 
A1  10:01      10:02     
A1  10:25      10:35 
A2  10:36      10:55

Ô­±íÓÐÉϰÙÍò±ÊÊý¾Ý£¬Ð§ÂÊÉÏÐèÒª¿¼ÂÇÒ»ÏÂ
ÓÐûÓÐÆäËüÇé¿ö??

²»»á£¬Õý³£Í¬Ò»¸öA¶¼ÊÇÏÈdowm,È»ºóUP

Ã²ËÆµÃÐèÒªÒ»個Ðò號ÁкÃ協ÖúÍê³É.

ÿ¸ödownºÍupÊÇÁ¬ÐøµÄÂ𣿻᲻»á³öÏÖÖ»ÓÐdown»òÕßupµÄÇé¿ö£¿

SQL code:
DECLARE @TB TABLE(A VARCHAR(20), B VARCHAR(20), time VARCHAR(20))
INSERT @TB
SELECT 'A1' , 'down' , '10:01' UNION ALL
SELECT 'A1' , 'up' , '10:02' UNION ALL
SELECT 'A1' , 'down' , '10:25' UNION ALL
SELECT 'A1' , 'up' , '10:35' UNION ALL
SELECT 'A2' , 'down' , '10:36' UNION ALL
SELECT 'A2' , 'up' , '10:55'

SELECT ID=IDENTITY(INT,1,1),* INTO #T from @TB

SELECT * from #T

--D


Ïà¹ØÎÊ´ð£º

×Ü»áÅöµ½¹ÖµÄÎÊÌ⣬sqlÎÊÌâ

sql2005
select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and  xxfwzf <>0 ),Ö´ÐÐËÙ¶ÈÂýµÄÒªËÀ£¬µ«ÊÇÈç¹û°Ñ(xxf>0 and  ......

SQLÓï¾äÎÊÌ⣬¸ßÊÖ°ïæ£¡£¡

½«Ò»¸ö±í21~30ɾ³ý£¬sqlÓï¾äÔõôд
Õâ¸öÌ«ÁýͳÁË£¬ÊÇÅÅÐòºóµÄµÚ21Ìõµ½30Ìõ¼Ç¼ɾ³ý»¹ÊÇijһÁÐÖµÔÚ21µ½30Ö®¼äµÄɾ³ý°¡£¿

21-30ÊÇʲôÒâ˼£¿×ֶεϰ¾Ídelete from table1 where col1>=21 and col1<=30
Ö¸µ ......

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

SQL ¶à±í²éѯ²é³öËùÒªµÄÊý¾Ý£¿

ÒÑÖª´ÓB,±íÖÐÕÒ³öID, NAMEÁ½ÏîÓëC±íÏàͬµÄÊý¾Ý£¬ÔÙÒÀ¾ÝB±íÖо­¹ý²éѯ³öÀ´µÄID,CODEÁ½ÏîÊý¾Ý²éѯÓëA±íID,CODEÁ½ÏîÏàͬµÄÊý¾ÝÖжÔÓ¦µÄEMAILÀ´£¬²¢ÁгöÈçÏÂD±íµÄÐÎʽ£¬²»ÖªÎÒÊÇ·ñ±íʾÇå³þ£¿Âé·³°ïÎÒÁÐһϹ«Ê½ºÃÂð£¿Íò· ......

ÐÂÉú£¬Win7£¬¸ÃÑ¡Ôñʲô°æ±¾SQL£¿

СµÜÕý×¼±¸×Ô¼ºÌáǰѧϰÊý¾Ý¿â£¬µ«ÊÇÏÖÔÚÓиöÎÊÌ⣬²»ÖªµÀ¸ÃÑ¡Ôñʲô°æ±¾µÄSQL

ѧУÒÔºóµÄÊéºÃÏñ½²SQLÓõÄÊÇSQL 2000£¬µ«ÊÇÎÒµÄϵͳÊÇWindows 7£¬Ã²ËƲ»ÄÜ×°£¬Ò²²»Ïë»»»ØXP£¨07Äê¾Í²»ÓÃXPÀ²£©£¬ËùÒÔÔÚÏ룬ÄÜ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ