MySQL datetime 날짜로 select하기

MySQL datetime 날짜로 select하기 select 컬럼명 from 테이블명 where date(컬럼명)='2018-01-23'; select 컬럼명 from 테이블명 where 컬럼명 between '2018-01-20' and '2018-01-24'; 위의 2가지 방법이 가장 기본적인 쿼리이다.

JAVA 삽입정렬 알고리즘

삽입정렬 InsertionSort


가장 (작은) 값을 시작으로 보내고, 남은 데이터를 적당한 위치에 삽입하며 정렬 영역을 키워간다.

이해하기 쉬운 영상




자바 코드


public class InsertionSort {
  public static void main(String[] args) {
    int[] index = { 4, 1, 3, 5, 2 };
    int i, j, temp, in;
    for (i = 1; i < index.length; i++) {
      in = index[i];
      for (j = i - 1; (j >= 0) && (in < index[j]); j--) {
        index[j + 1] = index[j];
      }
      index[j + 1] = in;
    }
    for (i = 0; i < index.length; i++) {
      System.out.print(index[i] + " ");
    }
  }
}

댓글

이 블로그의 인기 게시물

3계층 구조( 3 Tier Architecture )

GET방식과 POST방식이란? ( PHP )

MySQL Index태우기가 뭐에요?