Çë½ÌÒ»¸öSQLÓï¾ä
±í [Class]
cid cname ...
1 aaa
2 bbb
3 ccc
±í [New]
nid cid ...
1 1
2 1
3 1
4 3
ÏëÒªÖ´ÐÐSQL²éѯ֮ºóÏÔʾÈçÏÂ
1 aaa 3
2 bbb 0
3 ccc 1
ÇëÎʸÃÔõôд£¿
SQL code:
create table #Class
(
cid int identity(1,1) primary key,
cname nvarchar(20)
)
insert into #Class select 'aaa'
insert into #Class select 'bbb'
insert into #Class select 'ccc'
create table #New
(
nid int identity(1,1) primary key,
cid int
)
insert into #New select 1
insert into #New select 1
insert into #New select 1
insert into #New select 3
select C.*,isnull(N.cnt,0) from #Class C
full join
(
select cid,count(cid) cnt from #New group by cid
)N
on
C.cid=N.cid
SQL code:
create table #Class
(
cid int identity(1,1) primary key,
cname nvarchar(20)
)
insert into #Class select 'aaa'
insert into #Class select 'bbb'
insert into #Class select 'ccc'
create table #New
(
nid int identity(1,1) pr
Ïà¹ØÎÊ´ð£º
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
СµÜ£¬×î½üҪתÐÐÈ¥×öoracle¿ª·¢ÁË£¬ÓÉÓÚ´óѧ±Ïҵʱ£¬×ßÁ˸öÍä·£¬ÏÖÔÚºÜСÐÄ£¬ÎÊÏ£¬×öPL/SQLÓÐûÓÐǰ;£¿£¿£¿
µ±È»ÎÒ˵µÄÕâ¸öǰ;ÊÇÖ¸ ÒÔºóÒªÌø²Û£¬Êг¡¶ÔÕâÑùµÄÈ˲ŵÄÐèÇóÁ¿´ó²»´ó£¿£¿
3q ÄÇ¿´À´»¹Ö»ÄÜÏȽӴ ......
ÓÐÁ½¸ö»òÒÔÉϵÄÔ¶³ÌÊý¾Ý¿â£¬ÈçºÎÓÃASP¼ì²âÁ¬½ÓËٶȲ¢Á¬½Ó×î¿ìµÄMSSQLÊý¾Ý¿â£¿
ÓÐÕâÑùµÄASPº¯ÊýÂð£¿ÎÒGOOGLEÁËһϣ¬ÕÒ²»µ½¡£
PHP+MYSQLÏÂÓÐÕâÖÖÀý×Ó£º
PHP code:
Example:
$wgDBservers = array(
......