insert all into T_TRAIN_MARSHALLING <trim prefix="(GKEY," suffix=")" suffixOverrides=","><if test="ID != null and ID != '' ">ID,</if><if test="1 == 1">TRAIN_NUM,</if><if te…
sql 查询某个条件下多条数据中最新的一条数据或最老的一条数据 test_user表结构如下: 需求:查询李四.王五.李二创建的最初时间或者最新时间 1:查询最初的创建时间: SELECT * FROM( SELECT * FROM test_user ) AS tu WHERE NOT EXISTS ( SELECT * FROM( SELECT * FROM test_user ) AS tu2 WHERE tu2.user_name=tu.user_name AND DATE(tu.tim…
Oracle一次插入多条数据. 表结构: create table aa ( ID NUMBER(11) PRIMARY KEY, NAME VARCHAR2(20) ) 第一种方式: insert into aa (ID,NAME) select 1,'1' from dual union allselect 2,'2' from dual 第二种方式: INSERT ALLINTO aa (ID,NAME ) VALUES (3,'3')INTO aa (ID,NAME ) VALUES…