代码如下: drop table if exists dd; create table dd ( user_id int , class_no int , score int ); insert into dd values (1,1,1), (2,1,1), (3,1,2), (4,2,2); select class_no ,avg(score)from dd group by class_no order by avg(score); 在MySQL下面测试通过。[ 查看全文 ]
create PROCEDURE dbo.SP_SPIDtoIP @SPID int AS -- SPID to MAC -- lj DECLARE @MAC as varchar(12) SELECT @MAC = NET_ADDRESS FROM master..sysprocesses WHERE SPID = @SPID -- MAC to IP DECLARE @MACDisplay as varchar(18) DECLARE @IP as varchar(15) CREATE TABLE #temp (OUTPUT varchar(255) null) SET NOCOUNT ON INSERT INTO #temp EXEC master..xp_cmdshell 'arp -a' if @@error<...[ 查看全文 ]