ÇósqlÓï¾äÀí½â
±íA
¿¨ºÅ ʱ¼ä
1 null
2 null
3 null
±íB
¿¨ºÅ ʱ¼ä
1 2008-1-6
1 2004-5-3
2 2005-5-6
3 2003-5-9
3 2001-2-3
ÎÊÌ⣺¸üР±íAÀïµÄ ÏàÓ¦¿¨ºÅµÄʱ¼äΪ ±íBÀïÏàÓ¦¿¨ºÅµÄ£¨×îС£©Ê±¼ä
ÕýÈ·µÄ½á¹û£º
1 2004-5-3£¨×îС£©
2 2005-5-6
3 2001-2-3£¨×îС£©
liangCK£º
SQL code:
update a set
ʱ¼ä = b.ʱ¼ä
from tb1 as a
join tb2 as b
on a.¿¨ºÅ= b.¿¨ºÅ
where not exists(select * from tb2
where ¿¨ºÅ=b.¿¨ºÅ and ʱ¼ä> b.ʱ¼ä)
b ÄÚ±í
1 2007 1 2007
1 2008 1 2008
1 2004 1 2004
2007 = <all N
2008 = <all
Ïà¹ØÎÊ´ð£º
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
Á½ÖÖ´íÎó£º
1.Èç¹ûÎÒÕâÑùÉêÃ÷£ºResultSet rs;´íÎóÌáʾÈçÏ£º
An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48: ......
½«Ò»¸ö±í21~30ɾ³ý£¬sqlÓï¾äÔõôд
Õâ¸öÌ«ÁýͳÁË£¬ÊÇÅÅÐòºóµÄµÚ21Ìõµ½30Ìõ¼Ç¼ɾ³ý»¹ÊÇijһÁÐÖµÔÚ21µ½30Ö®¼äµÄɾ³ý°¡£¿
21-30ÊÇʲôÒâ˼£¿×ֶεĻ°¾Ídelete from table1 where col1>=21 and col1<=30
Ö¸µ ......
SELECT Count(*) from In_fo WHERE Reader_Time between #" + time1 + "# AND #" + time2 + "# and id=" + userid + ";
ÉÏÃæÊÇÎÒдµÄsqlÓï¾ä Reader_TimeÊÇʱ¼äÀàÐÍ idΪÊý×Ö ......
±íÖа´datadate,tradeidΪÖ÷¼ü£¬Ò²¾ÍÊÇ˵tradeid»áÖظ´³öÏÖÔÚ²»Í¬ÌìÖУ¬Í¬Ò»ÌìµÄtradeidÊDz»Í¬µÄ¡£ÏÖÔÚÎÒÏ£ÍûÈ¡Ò»¶Îʱ¼ä·¶Î§ÄÚ²»Öظ´µÄtradeid£¬ÇÒֻҪÿ¸ötradeidµÄ×îºóÒ»´Î³öÏÖµÄÄÇÌõ¡£sqlÓï¾ä¸ÃÔõôд
£º ......