sql 줄 바 꾸 기
3223 단어 sql
풍부 한 텍스트 내용 중 에는 통상 적 으로 차 를 되 돌리 고 줄 을 바 꾸 는 내용 이 나타난다.sql 데이터베이스 에서 이 리 턴, 줄 바 꿈 자 는 html 를 출력 한 후 빈 칸 으로 표 시 됩 니 다.
여 기 는 데이터 내 보 내기, 가 져 오기 에서 발 견 된 것 입 니 다. 보통 리 턴, 줄 바 꿈 자 를 찾 아 < br > 로 교체 합 니 다.
여기 'sql 함수' 를 사 용 했 습 니 다.replace (string expression, string pattern, string replacement), 첫 번 째 매개 변수: 찾 을 필드.두 번 째 인자: 찾 을 문자 입 니 다.세 번 째 인자: 바 꿀 문자 입 니 다.
char(9)
char(10)
char(13)
1 > 리 턴 부적 char(13)
SELECT *, REPLACE (detail, CHAR (13), '< br >') AS 는 교 체 된 내용 을 보 여 줍 니 다 FROM Test
2 > 줄 바 꾸 기
SELECT *, REPLACE (detail, CHAR (10), '< br >') AS 는 교 체 된 내용 을 보 여 줍 니 다 FROM Test
3 > 리 턴 줄 바 꾸 기
SELECT *, REPLACE (detail, CHAR (13) + CHAR (10), '< br >') AS 는 교 체 된 내용 을 보 여 줍 니 다 FROM Test
4 > Enter 줄 바 꾸 기 를 < BR > < BR > 로 바 꿉 니 다.
UPDATE TestSET detail = REPLACE(detail, CHAR(13) + CHAR(10), '
')
update t_news set content=REPLACE(content, CHAR(13) + CHAR(10), '
') where news_type=3
내용 앞 에 두 개의 빈 칸, 전각 의 update tnews set content=' '+content where news_type=3
===========================
어떻게 sql 문 구 를 사용 하여 한 필드 에 줄 바 꿈 문자 가 있 는 지 판단 합 니까?
select * from where instr( ,chr(13))>0
chr(13) 。
sql server 2000 에 서 는 인 스 턴 트 가 지원 되 지 않 습 니 다. 함수 가 인 스 터 를 charindex 로 바 꾸 면 됩 니 다.
charindex
、
CHARINDEX ( char1 ,string1 [ , start_location ] )
char1 string1 Unicode (nvarchar nchar) , Unicode 。CHARINDEX text、ntext image 。
char1 string1 NULL, 70 , CHARINDEX NULL。 65 , CHARINDEX char1 string1 NULL NULL 。
char1 string1, CHARINDEX 0。
char1 , 。
string1 , 。string1 。
start_location string1 char1 。
start_location 、 , string1 。start_location bigint 。
string1 char1
string1 char1 0
、
USE AdventureWorks
SELECT CHARINDEX('bicycle', DocumentSummary)
FROM Production.Document
WHERE DocumentID = 3;
48。
SELECT CHARINDEX('bicycle1', DocumentSummary, 5)
FROM Production.Document
WHERE DocumentID = 3;
0。
DocumentSummary "bicycle" 。
:
select * from Production.Document
where DocumentSummary like'%bicycle%'
, :
select * from Production.Document
where charindex('bicycle',DocumentSummary)>0 like'%%' .
sql 2005 .
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
깊이 중첩된 객체를 정확히 일치 검색 - PostgreSQL목차 * 🚀 * 🎯 * 🏁 * 🙏 JSON 객체 예시 따라서 우리의 현재 목표는 "고용주"사용자가 입력한 검색어(이 경우에는 '요리')를 얻고 이 용어와 정확히 일치하는 모든 사용자 프로필을 찾는 것입니다. 즐거운 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.