1
CREATE TABLE #Testing
(
[id] [int] IDENTITY(1,1) NOT NULL,
[store_id] [varchar](3) NULL,
[sku] [varchar](14) NULL,
[qty] [bigint] NULL,
[http_action] [varchar](20) NULL
)
INSERT INTO #Testing (store_id, sku, qty, http_action)
SELECT '001','123456',1,'POST'
UNION ALL
SELECT '002','123456',1,'POST'
UNION ALL
SELECT '002','123456',1,'DELETE'
UNION ALL
SELECT '001','223456',5,'DELETE'
那是什麼,你可以運行到返回最小[ID]爲每一個查詢[http_action]?喜歡的東西:
MIN_DELETE MIN_POST
3 1
GO
來自哪兒呢三個? – Paparazzi 2013-05-01 19:20:10