Views 33931 Votes 0 Comment 1
?

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
106 System/OS [linux] ipfwadm를 이용한 패킷필터링(구버전) hooni 2003.04.23 13023
105 System/OS [linux] DHCP(Dynamic Host Configuration Protocol) 서버 hooni 2003.04.23 13024
104 System/OS [linux] Proftpd 설치 가이드 hooni 2003.04.23 13028
103 System/OS [linux] 한글 URL 인식할 수 있게 아파치(Apache) 설정 (mod_url.c 설치) hooni 2013.04.23 13067
102 System/OS [linux] 계정관리하기(내공쌓기) hooni 2003.04.23 13161
101 System/OS [linux] 아파치설치/설정 - SSI(Server Side Include) hooni 2003.04.23 13207
100 System/OS [linux] Xwindow/Xmanager 사용 hooni 2003.04.23 13341
99 System/OS [ms-sql] 프로시져 예제.. file hooni 2013.04.23 13406
98 System/OS [linux] 쉘 스크립트에 대한 설명과 예제.. hooni 2003.04.23 13414
97 System/OS [linux] 프로그램 설치방법 (내공쌓기) hooni 2003.04.23 13433
96 System/OS [linux] 간단한 vi편집기 사용 명령 hooni 2003.04.23 13456
95 System/OS [linux] 기존 환경설정 저장하면서 커널 컴파일.. hooni 2003.04.23 13467
94 System/OS [linux] 쉘 환경변수 PS1(프롬프트) hooni 2003.04.23 13493
93 System/OS [linux] ipchains 옵션 hooni 2003.04.23 13619
92 System/OS 아파치(Apache) 인증사용(htaccess)으로 특정 디렉토리에 암호걸기 hooni 2013.04.23 13659
91 System/OS [linux] 셀 스크립트 if, for, case in.. hooni 2003.04.23 13696
Board Pagination Prev 1 5 6 7 8 9 ... 13 Next
/ 13