데이터베이스별 결과 제한 쿼리(top, rownum, Limit, inst_num, groupby_num, orderby_num)
1. MSSQL - TOP키워드 너무 잘 알고 있듯이 다음과 같이 쓰면 된다. SELECT top 100 * FROM testTable 2. Oracle - rownum 키워드 ROWNUM 기본 SELECT id,password, rownum FROM test WHERE rownum 한도 10개까지만 가져온다. mysql> select * from userTable where sex='male' limit 0, 20; >> 이경우 0부터 시작한다. 첫번째부터 20개까지만 추출한다. mysql> select no from userTable where gender='male' limit 10, 20; >> 11 번째 부터 20개까지만 추출한다. (0부터 시작이니까 0~9, 10~19, 20~29,... ) ..
더보기
URLEncoding 함수 사용하기
function URLEncode(const S: string): string; var Idx: Integer; // loops thru characters in string begin Result := ''; for Idx := 1 to Length(S) do begin if S[Idx] in ['A'..'Z', 'a'..'z', '0'..'9', '-', '=', '&', ':', '/', '?', ';', '_', '.'] then Result := Result + S[Idx] else Result := Result + '%' + IntToHex(Ord(S[Idx]), 2); end; end;
더보기