mysql:
INSERT INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee)
VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '1', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '2', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '3', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '4', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '5', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '6', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '7', '0.1', '0.5'),
((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = #{serverid}), '8', '0.1', '0.5');
Oracle:
INSERT ALL
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '1', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '2', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '3', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '4', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '5', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '6', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '7', '0.1', '0.5')
INTO configfeeitem (ConfigID, PaperTypeID, GrayFee, ColorFee) VALUES ((SELECT ConfigID FROM configs WHERE ConfigName = 'ServerConfig' AND TargetID = 1), '8', '0.1', '0.5')
SELECT 1 FROM DUAL;
SELECT 1 FROM DUAL;的作用?
这是oracle中自带的一个虚拟表,用它来可以查看一些系统信息;比如系统时间 :
select sysdate from dual;
dual是虚拟表,这句话的意思就是返回一个值,这里的值就是1;