select id,country,p_no,msg from product where country=2
union
select * from product where pno in
(select pno from product where pno not in (select pno from product where country=2))
这样?
不知道是不是这个意思,你可以测试下
select
t.*
from
product t
where
country=2
union all
select
t1.*
from
product t1
where
country=(select min(country) from product t2 where t1.p_no=t2.p_no)
and
p_no not in(select p_no from product where country=2)