為了理解這個概念,我們使用表‘Details_city’中的數據,如下 –
mysql> Select * from details_city; +--------+--------+ | City1 | City2 | +--------+--------+ | Delhi | Nagpur | | Delhi | Mumbai | | Nagpur | Delhi | | Katak | Delhi | | Delhi | Katak | +--------+--------+ 5 rows in set (0.00 sec)
登錄后復制
現在,以下查詢將從details_city表中刪除反向重復值 –
mysql> Select a.city1,a.city2 from details_city a WHERE a.city1 <= a.city2; +-------+--------+ | city1 | city2 | +-------+--------+ | Delhi | Nagpur | | Delhi | Mumbai | | Delhi | Katak | +-------+--------+ 3 rows in set (0.06 sec)
登錄后復制
以上就是如何從MySQL表中刪除以相反順序存儲的重復值?的詳細內容,更多請關注www.92cms.cn其它相關文章!