请问如何写这样的SQL语句
我用的是mySql,我有个入库表filmin,
create table if not exists filmin(name varchar(50) not null,type char(15) not null,
customer char(30) not null,size varchar(15),number smallint,inDate Date,memo varchar(50)) engine=InnoDB;
现在我想查询:根据字段name,type,customer组合唯一,并且入库日期inDate是最新的,
$query="select name,type,customer,number,size,inDate from filmin where name like '".$uname_p."%' and type like '".$utype_p."%' and customer like '".$ucust_p."%' group by customer,name,type order by inDate desc";
可是获取的记录,入库日期是最早的,不是最新的,请问:我的SQL语句应该怎么写?
其中$uname_p,$utype_p,$ucust_p是输入的变量值