Assume the following:
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'
What’s a single query that you could run to return the minimum [id] for each [http_action]? Something like:
MIN_DELETE MIN_POST
3 1
GO