大
大米
Unregistered / Unconfirmed
GUEST, unregistred user!
先建一个表
create table test
(
stockcode char(8) NOT NULL,
issueprice numeric(16,4)
)
然后插入三条记录
Insert into test values ('0001', 100)
Insert into test values ('0002', 200)
Insert into test values ('0003', 300)
然后执行SQL查询
SELECT IssuePrice
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT AVG(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT SUM(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT MAX(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT MIN(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
结果@#$%#%#&^*
create table test
(
stockcode char(8) NOT NULL,
issueprice numeric(16,4)
)
然后插入三条记录
Insert into test values ('0001', 100)
Insert into test values ('0002', 200)
Insert into test values ('0003', 300)
然后执行SQL查询
SELECT IssuePrice
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT AVG(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT SUM(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT MAX(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
UNION ALL
SELECT MIN(IssuePrice)
FROM test
WHERE StockCode IN ('0001', '0002', '0003')
结果@#$%#%#&^*