제목 : 쿼리문 묶기 연습(동적 쿼리문 만들기)
글번호:
|
|
71
|
작성자:
|
|
레드플러스
|
작성일:
|
|
2014/02/06 오후 12:16:00
|
조회수:
|
|
7585
|
-- 쿼리문 묶기 연습
Print 'Select * From AdminMemos';
Print 'Select * From AdminMemos Where Num = 2';
Print 'Select * From AdminMemos Where Content Like ''%방가%''';
Print 'Select * From AdminMemos Where Content Like ''' + '%방가%''';
Print 'Select * From AdminMemos Where Content Like ''%' + '방가' + '%''';
Print 'Select * From ' + 'AdminMemos' + ' Where Content Like ''%' + '방가' + '%''';
Declare @Content VarChar(8000)
Set @Content = '안녕'
Print 'Select * From AdminMemos Where Content Like ''%' + @Content + '%''';