¾«µäSQLÓï¾ä
·ÖÀàͳ¼Æ×ÜÊý²¢ÅÅÐò¶à±íÁªºÏ²éѯµÄÁ½ÖÖ·½·¨
Àý:
²éѯµØÇø±íÖи÷Ê¡ÏÂÃæ³ÇÊÐ×ÜÊý,²¢¶Ô²éѯ½á¹ûÈ¡Ç°Ê®Ãû
·¨Ò»:
select b.id,a.[name],b.counts from n_area a,(select top 10 parent_id as id,sum(parent_id) as counts from n_area where parent_id<>0 group by parent_id order by sum(parent_id) desc
) b where a.id=b.id
·¨¶þ:
select top 10 a.id,a.[name],(select count(*) from n_area b where b.parent_id=a.id ) as counts from n_area a where a.parent_id=0 order by counts desc
Àý:
²éѯ·¢Ìù±íÖлظ´Êý×î¶àµÄÇ°Ê®Ìõ·¢Ìù,(·¢ÌûÓë»ØÌûͬһ±í,²éѯ³ö·¢ÌûÖ÷Ìâ,·¢ÌûID,·¢ÌûÈË(Áí±í),»ØÌûÊý)
select a.mid,a.mtitle,(select c.uimg from BBS_Power c where c.uid=a.uid and c.uclass=a.uclass) as img from BBS_Msg a,(select top 10 partenID as id,sum(partenID) as counts from BBS_Msg where partenID<>0 group by partenID order by sum(partenID) desc) b where a.mid=b.id
Ïà¹ØÎĵµ£º
SELECT LEFT(RTRIM('20080927p1058'),LEN('20080927p1058')-2)
SELECT SUBSTRING('20080927p1058',1,LEN('20080927p1058')-2)
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*whit ......
SqlÓï¾ä×÷Ϊ¹ú¼Ê±ê×¼µÄÊý¾Ý¿â²éѯÓï¾ä£¬±±¾©°á¼Ò¹«Ë¾ ±±¾©Êèͨ¹«Ë¾ÔÚ¸÷ÖÖ±à³Ì»·¾³Öеõ½Á˹㷺µÄÓ¦Óá£×÷Ϊһ¸ö³ÉÊì¡¢Îȶ¨µÄϵͳ£¬Óû§µÇ½ºÍÃÜÂëÑéÖ¤ÊDZز»¿ÉÉٵġ£ÔÚƽʱµÄ±à³Ì¹¤×÷ÖÐÐí¶à³ÌÐòÔ±ÔÚÓÃsqlÓï¾ä½øÐÐÓû§ÃÜÂëÑé֤ʱÊÇͨ¹ýÒ»¸öÀàËÆÕâÑùµÄÓï¾äÀ´ÊµÏֵģº
strSel = " Select * from Óû§±í where ÐÕÃû= '" ......
Oracle µÄSQL*LOADER¿ÉÒÔ½«ÍⲿÊý¾Ý¼ÓÔص½Êý¾Ý¿â±íÖС£ÏÂÃæÊÇSQL*LOADERµÄ»ù±¾Ìص㣺
1£©ÄÜ×°È벻ͬÊý¾ÝÀàÐÍÎļþ¼°¶à¸öÊý¾ÝÎļþµÄÊý¾Ý
2£©¿É×°Èë¹Ì¶¨¸ñʽ£¬×ÔÓɶ¨½çÒÔ¼°¿É¶È³¤¸ñʽµÄÊý¾Ý
3£©¿ÉÒÔ×°Èë¶þ½øÖÆ£¬Ñ¹ËõÊ®½øÖÆÊý¾Ý
4£©Ò»´Î¿É¶Ô¶à¸ö±í×°ÈëÊý¾Ý
5£©Á¬½Ó¶à¸öÎïÀí¼Ç¼װµ½Ò»¸ö¼Ç¼ÖÐ
6£©¶ÔÒ»µ¥¼Ç¼·Ö½âÔÙ×°Èëµ½± ......
ROW_NUMBER ·µ»Ø°´Ò»¶¨¹æÔòÅÅÐòµÄµ±Ç°¼Ç¼¶ÔÓ¦µÄÐкÅ
±ÈÈçÎÒÃÇÓÐÕâÑùÒ»¸öÓ¦Óó¡¾°£º
ÏÖÔÚÓиö±ÈÈü£¬ÐèÒª´ÓÍøÉϲÎÈüÕß´Ó´ÓÍøÂçÉϱ¨Ãû£¬È»ºóÈ¥×îÔ籨ÃûµÄ5¸öÈ˲μӱÈÈü£¬Îª´ËÎÒÃÇʵÏÖÈçÏ£º
1.Ϊ´ËÎÒÃÇÒª½¨Á¢Ò»ÕűíÀ´±£´æ±¨Ãû²ÎÈüÕßµÄÐÕÃû¼°Æð±¨Ãûʱ¼ä
CREATE
TABLE [dbo].[UserEnroll](
[UserName] [nvarchar] ......
ÓõÚÒ»ÖÖ·½·¨£¬ÉÏ´«·þÎñÆ÷ºó£¬ÔÚһЩ·þÎñÆ÷ÖУ¬¿ÉÄÜ»á³öÏÖÒÔÏ´íÎó£º
±ØÐëÔÚweb.configÖÐ¼Ó <system.web><identity impersonate="false"/></system.web> ,·ñÔò³öÏÖ´íÎó£ºSystem.Data.OleDb.OleDbException: δָ¶¨µÄ´íÎó¡£¼ÓÁËÒԺ󣬵ã¶à¼¸´ÎÁ´½Ó£¬» ......