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

sql ²éѯÎÊÌâ

±íA
guiGeID shangPinID yanSe chiMa
1 1001 °×É« 37
2 1001 °×É« 37
3 1002 ºÚÉ« 42
4 1002 ºÚÉ« 42
5 1002 °×É« 37
6 1003 °×É« 37
7 1004 °×É« 37


ÄÜ·ñ¸ù¾Ý±íA²éѯ³ö shangPinID¡¢yanSe¡¢chiMa ÍêÈ«ÏàͬµÄËùÓÐÐÅÏ¢
²¢ÇÒ¸ù¾Ý shangPinID ÅÅÐò
¸ù¾ÝÉϱíµÃµ½µÄÐÅÏ¢Ó¦¸ÃÈçÏÂ

guiGeID shangPinID yanSe chiMa
1 1001 °×É« 37
2 1001 °×É« 37
3 1002 ºÚÉ« 42
4 1002 ºÚÉ« 42

SQL code:
select *
from tb t
where
(select count(1)
from tb
where shangPinID=t.shangPinID and yanSe=t.yanSe and chiMa=t.chiMa
)>1


SQL code:
-- =============================================
-- Author: T.O.P
-- Create date: 2009/11/26
-- Version: SQL SERVER 2005
-- =============================================
declare @TB1 table([guiGeID] int,[shangPinID] int,[yanSe] varchar(4),[chiMa] int)
insert @TB1
select 1,1001,'°×É«',37 union all
select 2,1001,'°×É«',37 union all
select 3,1002,'ºÚÉ«',42 union all
select 4,1002,'ºÚÉ«',42 union all
select 5,1002,'°×É«',37 union all
select 6,1003,'°×É«',37 union all
select 7,1004,'°×É«',37

select *
from @TB1 a
where 1<(select count(1) from @tb1 where a.


Ïà¹ØÎÊ´ð£º

csvÎļþת»»³Ésqlµ¼Èëµ½Êý¾Ý¿â£¬Ã»ÓÐÊý¾ÝΪºÎ£¿

Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......

sqlÓï¾ä¶à±í¶à×ֶβéѯ - MS-SQL Server / »ù´¡Àà

ÎÒÓжà¸ö±íA B C ½á¹¹ÊÇÒ»ÑùµÄ£¬¶¼ÓÐ2¸ö×Ö¶ÎnameºÍcontent,ÎÒÒªËÑË÷ËùÒÔ±íËùÓÐ×Ö¶ÎÖаüº¬¡°Öйú¡±µÄÄÚÈÝ Õâ¸öSQLÓï¾äÔõôд 

ÈçºÎ½«¶à¸ö±íµÄ²éѯ½á¹ûÁ¬³ÉÒ»¸ö±í Õâ¸öSQLÓï¾äÔõôд ±íµÄ½á¹¹ÊÇÒ»ÑùµÄ
ÀýÈç£ ......

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

ÇóÒ»sql¡¾Ð»Ð»¡¿ - MS-SQL Server / »ù´¡Àà

ÐèÇóÈçÏ£º
a±í:
 p_id status  
  1 0
  2 0
b±í
rec_id pid purchase_qty receive_qty flag
1 1 10 10 0
2 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ