Views 33920 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
154 System/OS [windows] 98/ME 속도 빠르게 튜닝(부팅,메모리,레지스터) hooni 2003.04.23 50439
153 System/OS [windows] 도스 사용 팁 hooni 2003.04.23 17806
152 System/OS [windows] 여러가지 활용 팁 hooni 2003.04.23 19969
151 System/OS [windows] 배치(bat)파일 제작 방법 hooni 2003.04.23 17002
150 System/OS [linux] 패킷 스니퍼링 hooni 2003.04.23 16315
149 System/OS [linux] 패킷의 소스 주소 바꾸기 hooni 2003.04.23 18784
148 System/OS [linux] iptables 명령어 매뉴얼(options) hooni 2003.04.23 11333
147 System/OS [linux] 간단한 NAT 설정 script hooni 2003.04.23 12597
146 System/OS [linux] 랜카드 2개 설정 & iptables 로 사설 ip.. hooni 2003.04.23 14732
145 System/OS [linux] apache, php, jsp 환경설정하기.. hooni 2003.04.23 15232
144 System/OS [linux] Oracle8.1.6, Mysql+PHP+Zend Optimizer+APACHE+Tomcat(jsp,servlet)+IMAP+gd hooni 2003.04.23 32452
143 System/OS [linux] 특수문자 환경 설정(stty) hooni 2003.04.23 15275
142 System/OS [linux] 메타(기호)문자의 의미와 사용 hooni 2003.04.23 16384
141 System/OS [linux] 프로세스 상태확인(ps) hooni 2003.04.23 12703
140 System/OS [linux] 종료와 종료코드 확인(환경변수에서) hooni 2003.04.23 15540
139 System/OS [linux] 셀 스크립트 if, for, case in.. hooni 2003.04.23 13686
Board Pagination Prev 1 2 3 4 5 6 ... 13 Next
/ 13