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

Éú³ÉÊ¡ÊеÄSQL½Å±¾

 --Ê¡¼¶   Provincial
--³ÇÊР  City
create table Provincial(pid int,Provincial varchar(50),primary key (pid))
insert into Provincial values(1,'±±¾©ÊÐ')
insert into Provincial values(2,'Ìì½òÊÐ')
insert into Provincial values(3,'ÉϺ£ÊÐ')
insert into Provincial values(4,'ÖØÇìÊÐ')
insert into Provincial values(5,'ºÓ±±Ê¡')
insert into Provincial values(6,'ɽÎ÷Ê¡')
insert into Provincial values(7,'̨ÍåÊ¡')
insert into Provincial values(8,'ÁÉÄþÊ¡')
insert into Provincial values(9,'¼ªÁÖÊ¡')
insert into Provincial values(10,'ºÚÁú½­Ê¡')
insert into Provincial values(11,'½­ËÕÊ¡')
insert into Provincial values(12,'Õã½­Ê¡')
insert into Provincial values(13,'°²»ÕÊ¡')
insert into Provincial values(14,'¸£½¨Ê¡')
insert into Provincial values(15,'½­Î÷Ê¡')
insert into Provincial values(16,'ɽ¶«Ê¡')
insert into Provincial values(17,'ºÓÄÏÊ¡')
insert into Provincial values(18,'ºþ±±Ê¡')
insert into Provincial values(19,'ºþÄÏÊ¡')
insert into Provincial values(20,'¹ã¶«Ê¡')
insert into Provincial values(21,'¸ÊËàÊ¡')
insert into Provincial values(22,'ËÄ´¨Ê¡')
insert into Provincial values(23,'¹óÖÝÊ¡')
insert into Provincial values(24,'º£ÄÏÊ¡')
insert into Provincial values(25,'ÔÆÄÏÊ¡')
insert into Provincial values(26,'Çຣʡ')
insert into Provincial values(27,'ÉÂÎ÷Ê¡')
insert into Provincial values(28,'¹ãÎ÷׳×å×ÔÖÎÇø')
insert into Provincial values(29,'Î÷²Ø×ÔÖÎÇø')
insert into Provincial values(30,'ÄþÏÄ»Ø×å×ÔÖÎÇø')
insert into Provincial values(31,'н®Î¬Îá¶û×ÔÖÎÇø')
insert into Provincial values(32,'ÄÚÃɹÅ×ÔÖÎÇø')
insert into Provincial values(33,'°ÄÃÅÌرðÐÐÕþÇø')
insert into Provincial values(34,'Ïã¸ÛÌرðÐÐÕþÇø')
--select pid,Provincial from Provincial
create table City(cid int not null,city varchar(50) primary key,pid int foreign key references Provincial(pid))
----------------------------------------------------------------------------------------------------------------------------------------
-----------------------------


Ïà¹ØÎĵµ£º

SQLº¯ÊýSubstringÌáÈ¡²¿·Ö×Ö·û´®

¹¦ÄÜ£º·µ»Ø×Ö·û¡¢¶þ½øÖÆ¡¢Îı¾»òͼÏñ±í´ïʽµÄÒ»²¿·Ö
Óï·¨£ºSUBSTRING ( expression, start, length )
          SQL ÖÐµÄ substring º¯ÊýÊÇÓÃÀ´×¥³öÒ»¸öÀ¸Î»×ÊÁÏÖеÄÆäÖÐÒ»²¿·Ö¡£Õâ¸öº¯ÊýµÄÃû³ÆÔÚ²»Í¬µÄ×ÊÁÏ¿âÖв»ÍêÈ«Ò»Ñù£º
²ÎÊý£º
expression ×Ö·û´®¡¢¶þ½øÖÆ×Ö·û´®¡¢Î ......

SQL Êý¾Ý¿â¼ä¸´ÖƱí

·½·¨Ò»£º
DB1  tb1  
DB2  tb2
Ñ¡ÔñDB1 µ½±íµÄÁбíÄÇÀï
Ñ¡Ôñtb1±í ÓÒ¼ü ËùÓÐÈÎÎñ Êý¾Ýµ¼³ö
ÏÂÒ»²½  Ñ¡ÔñÄãÒªµ¼³öµÄÊý¾Ý¿âDB1  ÏÂÒ»²½ Ñ¡ÔñÄãÒªµ¼ÈëµÄÊý¾Ý¿âDB2
ÏÂÒ»²½  Ñ¡ÔñÄãÒªµ¼µÄ±í£¨Ç°Ãæ»­¹´£©tb1£¬ ºóÃæ¶ÔÓ¦µÄÊÇÐÂÊý¾Ý¿âµÄ±íÃûtb2£¨Ä¬ÈÏÊÇÏàͬ±íÃû£¬¿ÉÐ޸ģ© ÏÂÒ»²½ ÍêÁË ......

oracle±È½Ï¿ìµÄ·ÖÒ³sql

 ·½°¸1 ÊÊÓÃÓÚoracle9iÒÔÉÏ£¡
select * from
(select row_number() over(order by sendid desc) rn,m.* from xxt_msgreceive m )
where rn <1010 and rn>=1000
·½°¸2
SELECT * from (SELECT A.*, ROWNUM RN from (SELECT * from xxt_msg where sendstatus=1  order by msgid desc) A WHERE ROWNUM < ......

SQL ServerËÀËø×ܽá

1.
ËÀËøÔ­Àí
   
¸ù¾Ý²Ù×÷ϵͳÖеĶ¨Ò壺ËÀËøÊÇÖ¸ÔÚÒ»×é½ø³ÌÖеĸ÷¸ö½ø³Ì¾ùÕ¼Óв»»áÊͷŵÄ×ÊÔ´£¬µ«Òò»¥ÏàÉêÇë±»ÆäËû½ø³ÌËùÕ¾Óò»»áÊͷŵÄ×ÊÔ´¶ø´¦ÓÚµÄÒ»ÖÖÓÀ¾ÃµÈ´ý״̬¡£
   
ËÀËøµÄËĸö±ØÒªÌõ¼þ£º
»¥³âÌõ¼þ
(Mutual exclusion)
£º×ÊÔ´²»Äܱ»¹²Ïí£¬Ö»ÄÜÓÉÒ»¸ö½ø³ÌʹÓá£
ÇëÇóÓë± ......

¹ØÓÚ sql server ÊÓͼ

    Ôø¾­ÓÐÏëͨ¹ý´´½¨sql serverÊÓͼµ÷ÕûÓ¦ÓÃÐÔÄܵÄÏë·¨£¬²»¹ýºóÀ´Ö¤Ã÷Õâ¸öÏë·¨ÊÇÐв»Í¨µÄ¡£
    ×öÁ˸öʵÑ飬ÔÚ¶ÔÔ­À´µÄsqlÓï¾äµ÷ÕûÖ®ºó´´½¨ÁËÁ½¸öÊÓͼ£¬°ÑÔ­À´µÄsqlת»»ÎªÊÓͼÁË£¬Í¨¹ýÊÓͼÀ´¶ÁÈ¡Êý¾Ý¡£×îÖյıȽϽá¹ûÊÇͨ¹ýÊÓͼ±ÈÖ±½ÓʹÓÃsqlÓï¾äÒªÂý£¬Í¨¹ýÊÓͼÀ´Ìá¸ßsqlµÄÐÔÄÜ¿´À´ÊDz»ÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ