一.group_concat函数,以指定的分割符合并列,与group by 一起用 例:selectgroup_concat(c.columnname separator ',') group by 二.preparedstatement.return_generated_keys 得到刚刚插入记录的id preparedstatementps .setxxx …… …… ps.executeupdate(
一.group_concat函数,以指定的分割符合并列值,与group by 一起用
例:select>group_concat(c.columnname separator ',') >group by>
二.preparedstatement.return_generated_keys 得到刚刚插入记录的id
preparedstatement>ps.setxxx
……
……
ps.executeupdate();
resultset>
rs.next();
int>
三.分页查询,得到查询的总条数
select sql_calc_found_rows *>
ps => rs.next();
int>
四、常见sql命令
drop table if exists `user`;create table `user` ( `uid` int(11) not null auto_incrementprimary key, `gid` int(11) default null, `username` varchar(15) not null, `password` varchar(15) not null,
foreign key (parent_id) reference parent(id) on delete cascade on>