select t.* from tb t where OBJECTTYPE = 0 and SUBDATE = (select min(SUBDATE) from tb where PHONENO = t.PHONENO)
select t.* from tb t where OBJECTTYPE = 0 and not exists (select 1 from tb where PHONENO = t.PHONENO and SUBDATE < t.SUBDATE)
------解决方案--------------------
SQL code
--1.
SELECT *
FROM order_rec a
WHERE a.OBJECTTYPE = 0 AND
(PHONENO, SUBDATE) IN
(SELECT PHONENO, MIN(SUBDATE) SUBDATE FROM order_rec t GROUP BY t.PHONENO);
--2.
SELECT *
FROM order_rec a
WHERE a.OBJECTTYPE = 0 AND
EXISTS (SELECT 1
FROM (SELECT PHONENO, MIN(SUBDATE) subdate FROM order_rec t GROUP BY t.PHONENO) b
WHERE b.PHONENO = a.PHONENO AND
b.SUBDATE = a.SUBDATE);
--3.
SELECT *
FROM order_rec
WHERE gid IN
(SELECT MIN(GID) KEEP(dense_rank FIRST ORDER BY SUBDATE) FROM order_rec GROUP BY PHONENO) AND
OBJECTTYPE = 0;