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

Çë¸ßÊÖ°ïÎÒдһÌõsqlÓï¾ä

Ç°¼¸Ì칫˾ÃæÊÔ£¬¼ûµ½Ò»Ìâ,Çë¸ßÊÖ°ïÎÒ½â´ð£¬Ð»Ð»£¡

ÄÚÈÝtable:
id    name    parentid
1      aaa    null
14    bbb    1
47    ccc    14
72    ddd    47

ÎÊÌ⣺

ÒÑÖª¼Ç¼ id=72,name='ddd',parentid=47
ÒªÇóÓÃÒ»ÌõsqlÓï¾ä»ñµÃËùÓбí¼Ç¼¡£


--ÊÇÕâÑùÂð£¿ÊÇÕâÑùµÄ»°£¬Ò²¾Í߯¼òµ¥ÁË£¡
select * from table where id=72 and name='ddd' and parentid=47;

ûÃ÷°×

select * from tb
?

Èç¹ûÊÇ2005,¿ÉÒÔ,ÄãÕÒСPÁºÐ´.

ÒýÓÃ
Èç¹ûÊÇ2005,¿ÉÒÔ,ÄãÕÒСPÁºÐ´.

Èç¹ûÊÇoracleÒ²¿ÉÒÔÕâÑùдÂð£¿

²»ÖªµÀ.

BOM½á¹¹

insert into @t_level select @id
select @id = pid from tb where id = @id and pid is not null
ÕâÓеãÔÎ ÔõôÓÐ2¸öselect ?

SQL code:
drop table test1;
drop table test2;
drop table test3;

create table test1(id int, name varchar(20), parentid int);
insert into test1(id, name, parentid) values(1,'luoyoumou1', 2)
insert into test1(id, name, parentid) values(72,'ddd', 47)
create table test2(id int, name varchar(20), parentid int);
insert into test2(id, name, parentid) values(2,'luoyoumou2', 3)
insert into test2(id, nam


Ïà¹ØÎÊ´ð£º

Á½¸öµ¼¹¹sql serverÊý¾Ý¿â,Êý¾Ýµ¼Èëµ¼³öÎÊÌâ

ÏÖÔÚÓÐÁ½¸öÒì¹¹µÄsql serverÊý¾Ý¿â,ÎÒÏ뽫µÚÒ»¸ö±íÖеÄÊý¾Ýµ¼Èëµ½µÚ¶þ¸ö±íÖÐ,×Ô¼ºÖ¸¶¨µ¼ÈëÊý¾ÝµÄ×Ö¶Î,ÈçºÎµ¼ÈëÊý¾ÝÄØ,´ó¼ÒÌÖÂÛÒ»ÏÂ?
dts¹¤¾ß

µ¼Èëµ¼³ö¹¤¾ß.

DD

¹þ¹þ£¬¹À¼ÆÕâλÊǵØQIOU¶¼Êܲ»Á˵Ä

Ö±½ÓÐ ......

SQL serverÊý¾Ý¼¯³ö´íÇóÖú

Á½ÖÖ´íÎó£º
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:    ......

sql ±¯¾ç

http://topic.csdn.net/u/20091008/12/a2577eba-1b5b-4e1e-ab20-0a047bf3f8d7.html?4385
1Â¥
liangCK
SQL code:
update a set
ʱ¼ä = b.ʱ¼ä
from tb1 as a
join tb2 as b
on a.¿¨ºÅ= b.¿¨ ......

Ò»¸ösqlÓï¾ä¡£

ÎÒÏë²é³ö
month
1
2
3
4
5
6
7
8
9
10
11
12
ÕâÑùµÄÊý¾Ý£¬ÈçºÎʵÏÖ°¡¡£¡£¡£

SQL code:

select top 12 month=identity(int,1,1) into #t from sysobjects
selec ......

sql ÈçºÎ¼Ó±íµÄÅÅËûËø

ÒòΪÊǶà¿Í»§¶Ë²Ù×÷µÄ£¬ËùÒÔÏ£ÍûÔÚ¸üеÄʱºò£¬¿ÉÒ԰ѱíÓÃÅÅËûËøËøס£¬ÆäËûÓû§²»¿ÉÒÔ²éѯºÍÐÞ¸Ä

֮ǰ¿´µ½Ïà¹ØÎÊÌâÀïÃæÌáµ½ WITH  (XLOCK) £¬ÎÒÕâÀï¿ÉÒÔÓÃÕâ¸öÂð£¿

WITH  (XLOCK) ÓÃÍêÖ® ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ