Contents

?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

기본적인 쿼리

select distinct * from 테이블명;


distinct * 이란건 한 행의 전체 칼럼값이 중복되는 데이터를 제거하고 뽑아냄..


예를 들어 중복된걸 제거한 제목을 뽑아 낼려면..

select distinct 제목 from 테이블명;;


전체 칼럼을 뽑아 내는데 중복된게 제목이 중복된건 하나만 출력하고 싶다면 index값이 있어야 함.

select * from 테이블명 where index in (select max(index) from 테이블명 group by 제목)


그리고 정렬은..

select * from 테이블명 where index in (select max(index) from 테이블명 group by 제목) order by 제목


만약 index값이 없다면 unique한 값으로 조건을 줘도 됨..



?

List of Articles
No. Category Subject Author Date Views
202 System/OS [linux] 아파치설치/설정 - 알리어싱(aliasing) hooni 2003.04.23 51370
201 System/OS [windows] 98/ME 속도 빠르게 튜닝(부팅,메모리,레지스터) hooni 2003.04.23 50447
200 System/OS [linux] 우분투 APM + phpmyadmin 설치 hooni 2013.10.07 49328
199 System/OS [linux] CentOS 6.x Cati 설치 (yum) hooni 2014.01.17 48596
198 System/OS HTTP 프로토콜 (브라우저와 웹서버 간의 통신) hooni 2003.04.23 48251
197 System/OS [linux] Masquerade 가상 ip분할기법 hooni 2003.04.23 47939
196 System/OS [linux] 네트웍 트래픽 모니터링(MRTG) hooni 2003.04.23 41845
195 System/OS [ms-sql] 서브스트링(substring), 프로시저(SP) 작성 예제 hooni 2013.04.23 41297
194 System/OS [dos] 노트북 백업 스크립트 xcopy 명령 예제 hooni 2003.04.23 40805
193 System/OS [mac] 맥에서 APM(apache,php,mysql) 구성하기 hooni 2013.04.23 38619
192 System/OS [linux] 처음 설치부터 APM 설치까지 (업데이트 할 것) hooni 2013.04.23 38271
191 System/OS CentOS 6.5 USB 설치 6 file hooni 2013.12.18 37680
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17