在数据库中有title,content字段,如果有两个相同的title,都叫ABC,而我想要的是第一个ABC对应的content,但是每次用where title="ABC";匹配到的都是第二个content内容,可不可以改变匹配的顺序呢?
content一样不一样?
如果不一样,可以这么写
select title from table where title = 'ABC' order by content desc
select title from table where title = 'ABC' order by content
两者之一
用id来排序,然后根据你需要DESc等排序处理。再获取对应数据