¾È±Ô °øºÎ¹æ

MS-SQL > replace() , convert()

µî·ÏÀÏ : 2017-06-30 17:09 Á¶È¸¼ö : 52,514

¿À´ÃÀº replace ÇÔ¼ö°ú Convert ¸¦ ÀÌ¿ëÇÑ µðºñ ÀÏ°ý ¼öÁ¤À» ¾Ë¾Æº¸°Ú½À´Ï´Ù.

¿¹¸¦ µé¾î °Ô½ÃÆÇ Á¦¸ñ(title) ÀÇ Æ¯Á¤ ¹®ÀÚ¸¦ Áö¿ìµçÁö, ´Ù¸¥ ±ÛÀÚ·Î ¹Ù²Ù°í ½ÍÀ» °æ¿ì¿¡ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.

update board set title=replace(title,'KKKK','')

À§¿Í °°ÀÌ Äõ¸®¸¦ ³¯¸®¸é µË´Ï´Ù. °£´ÜÇÏÁÒ????

³»¿ë°°Àº °æ¿ì´Â µ¥ÀÌÅÍ ÇüÀÌ(TEXT) ·Î µÇ¾î ÀÖ½À´Ï´Ù. ÀÌ·±°æ¿ì´Â replace °¡ µÇÁö ¾Ê½À´Ï´Ù.

ÀÌ·²¶§´Â convertÇÔ¼ö¸¦ ÀÌ¿ëÇؼ­ varchar ÇüÀ¸·Î Çüº¯È¯ ½ÃŲÈÄ Ä¡È¯ÇØ ÁÖ¸é µË´Ï´Ù.

update board set content=replace(convert(varchar(5000),content), 'KKKK', '')

À§¿Í °°ÀÌ °£´ÜÇÏ°Ô Äõ¸®¸¦ ³¯·Á¼­ ÀÛ¾÷À» ÇÒ ¼ö ÀÖ½À´Ï´Ù.

µµ¿òÀÌ µÇ¼Ì±æ..
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.