Skip to content

중복값을 제거해서 뽑아오기

MintState November 3, 2008 at 11:12 AM Views 19484

중복값을 제거해서 뽑아오기

중복된 값을 뽑아 오는 sql

$dd = "select distinct 아이템 from 테이블 order by 아이템";
$query = mysql_query($dd);
$j=0;
while ($row = mysql_fetch_array($query)) {
echo $row['goo']."<br />";

$j++;
}

중복된 데이터의 첫번째 배열을 뽑기 위해 다음과 같이 group을 쓴다.
select * from 테이블 group by 아이템

Share X Facebook LINE QR code

0 comments

Be the first to comment.