[MSSQL] 문자열 자르기

구분자로 자르기
문자열: ‘ABC\DE\FGH’
— ‘\’ 기준으로 앞에서 자르기
SELECT LEFT(‘ABC\DE\FGH’, CHARINDEX(‘\’, ‘ABC\DE\FGH’)-1);
결과: ABC
— ‘\’ 기준으로 중간에서 자르기
SELECT SUBSTRING(‘ABC\DE\FGH’, CHARINDEX(‘\’, ‘ABC\DE\FGH’)+1, LEN(‘ABC\DE\FGH’)-CHARINDEX(‘\’, ‘ABC\DE\FGH’)-CHARINDEX(‘\’, REVERSE(‘ABC\DE\FGH’)));
결과: DE
— ‘\’ 기준으로 뒤에서 자르기
SELECT RIGHT(‘ABC\DE\FGH’,CHARINDEX(‘\’, REVERSE(‘ABC\DE\FGH’))-1);
결과: FGH
길이로 자르기
문자열: ‘ABCDEFGH’
— 앞에서 자르기
SELECT LEFT(‘ABCDEFGH’, 3);
결과: ABC
— 중간에서 자르기
SELECT SUBSTRING(‘ABCDEFGH’, 4, 2);
결과: DE
— 뒤에서 자르기
SELECT RIGHT(‘ABCDEFGH’, 3);
결과: FGH
출처: http://developerking.tistory.com/1 [나는 개발자다]

Comments (76)

  1. Pingback: Slotxo

  2. Pingback: mơ thấy con cá đánh đề con gì

  3. Pingback: ตู้แปลภาษา

  4. Pingback: DevOps as a Service

  5. Pingback: mơ thấy bơi trong nước

  6. Pingback: mơ thấy gấu đánh con gì

  7. Pingback: kim ngưu và ma kết

  8. Pingback: xếp hạng các chòm sao

  9. Pingback: cây phong thuỷ phòng làm việc

  10. Pingback: giải mã ác mộng

  11. Pingback: mơ thấy mất xe đạp

  12. Pingback: how to change eu driving license for uk

  13. Pingback: Cornhole

  14. Pingback: nằm mơ thấy bắt được cá lóc

  15. Pingback: mơ bị sét đánh

  16. Pingback: nằm mơ thấy mình thắp hương

  17. Pingback: mơ thấy ăn ổi

  18. Pingback: Regression testing

  19. Pingback: red bull cases wholesale

  20. Pingback: mơ thấy cầu vồng

  21. Pingback: 만화보는사이트

  22. Pingback: slowed reverb sad songs

  23. Pingback: cbd for anxiety

  24. Pingback: cách tỏ tình lãng mạn

  25. Pingback: mơ bắt được cá trê

  26. Pingback: sự tôn trọng trong tình yêu

  27. Pingback: mơ thấy gái đánh con gì

  28. Pingback: Oxycontin For Sale Online

  29. Pingback: replika rolex

  30. Pingback: nbc bank

  31. Pingback: w88

  32. Pingback: relx infinity

  33. Pingback: Sexual harassment (disambiguation)

  34. Pingback: buy dilaudid iv online

  35. Pingback: W88casino

  36. Pingback: sa game

  37. Pingback: dịch vụ marketing tổng thể

  38. Pingback: W88casino

  39. Pingback: thuốc khớp malaysia

  40. Pingback: microsoft exchange hosting fiyat

  41. Pingback: bulut depolama,bulut,yedekleme,ücretsiz bulut hizmeti,en iyi bulut şirketi,en iyi bulut firması,bulut depolama fiyatı,en ucuz bulut depolama,en iyi bulut depolama hangisi,en iyi bulut depolama,bulut arşivleme sistemi,online yedekleme,bulut yedekleme

  42. Pingback: microsoft exchange mail

  43. Pingback: kurumsal it danışmanlığı

  44. Pingback: microsoft exchange mail

  45. Pingback: cheap cvv dumps

  46. Pingback: W88

  47. Pingback: bilişim danışmanlığı

  48. Pingback: Sunucu Teknik Destek

  49. Pingback: internet bağlantısı kopuyor

  50. Pingback: exchange online fiyat

  51. Pingback: HP Server Teknik Destek

  52. 응답

    canadian discount pharmacies
    natural substitute for viagra canada pharmacies online viagra no prescription substitute viagra [url=https://myspace.com/tvshake52]viagra online canada pharmacy[/url] buy viagra online uk canadian drugs without a prescription canada online pharmacy viagra pills from canada [url=https://www.storeboard.com/blogs/go-green/want-to-really-feel-better-follow-these-essential-nourishment-tips/4981678]viagra canadian[/url]
    viagra stories buying cialis in canada canadian pharmacy viagra online viagra brand for sale [url=http://www.v0795.com/home.php?mod=space&uid=253456]natural substitute for viagra[/url]

  53. 응답

    constantly i used to read smaller articles or reviews that also
    clear their motive, and that is also happening with this post which I am reading here.

  54. 응답

    I am no longer certain where you are getting your information, however great topic.
    I must spend some time studying more or understanding more.
    Thanks for great info I used to be looking for this info for my mission.

  55. 응답

    Do you have a spam problem on this site; I also am a blogger, and I was wondering your situation; many of us have developed some nice methods and we are looking to exchange techniques with others, please shoot me an email if interested.

  56. 응답

    I’m really enjoying the design and layout of your site. It’s a
    very easy on the eyes which makes it much more pleasant for me to
    come here and visit more often. Did you hire out a designer
    to create your theme? Exceptional work!

  57. 응답

    Hey there I am so happy I found your site, I really found
    you by mistake, while I was researching on Aol
    for something else, Regardless I am here now and would just like to say
    thank you for a incredible post and a all round thrilling blog (I also love the theme/design),
    I don’t have time to read it all at the moment but I have book-marked it and also added in your RSS feeds, so when I have
    time I will be back to read a great deal more, Please do keep up the awesome work.

  58. 응답

    Greetings from California! I’m bored to tears at work
    so I decided to browse your website on my iphone during lunch
    break. I love the knowledge you provide here and can’t wait to take a look when I get home.
    I’m shocked at how fast your blog loaded on my phone ..
    I’m not even using WIFI, just 3G .. Anyways, awesome site!

  59. 응답

    I loved as much as you’ll receive carried out right here.
    The sketch is attractive, your authored
    material stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following.
    unwell unquestionably come further formerly again as
    exactly the same nearly very often inside case you shield this hike.

  60. 응답

    Hello are using WordPress for your site platform?
    I’m new to the blog world but I’m trying to get started and create my own. Do you
    require any html coding expertise to make your own blog?
    Any help would be really appreciated! ps4 https://j.mp/3z5HwTp ps4 games

Leave a comment

이메일 주소는 공개되지 않습니다.