有人可以使用codeigniter共享一些如何从我的数据库中获取或显示重复数据的代码。
[id]
[1]
[2]
[3]
[3]
[4]
提前谢谢。
答案 0 :(得分:1)
试试这个
SELECT column_name FROM table_name GROUP BY column_name HAVING COUNT(column_name) > 1;
您可以在codeigniter中执行此操作
$sql_select = 'SELECT column_name FROM table_name GROUP BY column_name HAVING COUNT(column_name) > 1';
$query = $this->db->query($this->sql_select);
$result = $query->result_array();