Cómo eliminar los espacios en blanco en SQL

Cómo eliminar los espacios en blanco en SQL

La función LTRIM y RTRIM en SQL se utiliza para eliminar los espacios en blanco de una cadena. LTRIM elimina los espacios de lado izquierdo de la cadena y RTRIM los de lado derecho.

LTRIM(string): Elimina todos los espacios en blanco del comienzo de la cadena.

RTRIM(string): Elimina todos los espacios en blanco del final de la cadena.

REPLACE(string, caracter a remplazar, caracter por el que se remplaza ): Remplaza todos los caracteres que encuentra en el string.

 

Ejemplo 1

SELECT LTRIM(RTRIM('   Sample   '));
Resultado: 'Sample'

 Ejemplo 2

SELECT LTRIM('   Sample   ');
Resultado:'Sample   '

Ejemplo 3

SELECT RTRIM('   Sample   ');
Resultado:'   Sample'

Ejemplo 4

SELECT replace('   Sample Hola  ', ' ', ''); 
Resultado:'SampleHola'

 

Compartir

Comentarios (13)

  • Oatley Responder

    My family all the time say that I am wasting my time here at net, except I know I am getting knowledge daily by reading thes pleasant articles or reviews.

    Thursday, June 8, 2017 7:02 AM
  • Barnum Responder

    Good day I am so thrilled I found your web site, I really found you by mistake, while I was browsing on Google for something else, Anyways I am here now and would just like to say many thanks for a fantastic post and a all round interesting 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 included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the superb jo.

    Friday, June 16, 2017 7:10 AM
  • Nestor Responder

    Good article. I am going through a few of these issues as well..

    Thursday, June 22, 2017 3:09 PM
  • Le Hunte Responder

    I see you don't monetize your blog, don't waste your traffic, you can earn extra cash every month because you've got hi quality content. If you want to know what is the best adsense alternative, type in google: adsense alternative Mertiso's tips

    Friday, August 4, 2017 4:30 PM
  • Trevascus Responder

    cheap auto insurance cheap car insurance cheap car insurance cheap auto insurance

    Tuesday, August 22, 2017 12:05 AM
  • Sinclair Responder

    Fb is the primary social media website on this planet.

    Saturday, September 2, 2017 1:23 PM
  • Bateman Responder

    Then they will know that you're a vegetarian.

    Monday, September 4, 2017 10:39 PM
  • Streeter Responder

    We are looking for manufecturer / suppliers who can supply on regular basis with competitive price.

    Saturday, September 23, 2017 10:35 PM
  • Peter Responder

    Likewise, the most popular professors will enjoy massive influence as they teach vast global courses with registrants numbering in the hundreds of thousands (even though most popular” may well equate to most entertaining rather than to most rigorous).

    Saturday, October 7, 2017 8:59 PM
  • Moraes Responder

    Por favor, deixe-me saber se você está procurando por um escritor para seu blog. Você tem alguns realmente bom artigos e sentir eu seria uma boa aquisição. Se você quiser tirar um pouco da carga, gostaria como realmente para escrever alguns artigos para o seu blog em troca de um link para o meu. Por favor atirar me um e-mail se interessado. Obrigado !

    Wednesday, October 18, 2017 9:00 AM
  • da Rosa Responder

    Saudações Este é meu 1º comentar aqui, então eu só queria dar um alô rápido e dizer eu verdadeiramente desfrutar leitura através de seu posts do blog . Você pode recomendar qualquer outros blogs/sites/fóruns que rever o mesmo assuntos ? Graças a tonelada !

    Wednesday, October 18, 2017 5:54 PM
  • Selle Responder

    Greetings from Florida! I'm bored to death at work so I decided to check out your blog on my iphone during lunch break. I love the info you present here and can't wait to take a look when I get home. I'm amazed at how fast your blog loaded on my phone .. I'm not even using WIFI, just 3G .. Anyways, fantastic blog!

    Wednesday, October 25, 2017 10:25 AM
  • Loureiro Responder

    I intended t? compose ?ou this very litt?e note ?n order t? sa? thanks as before for the gorgeous ideas ?ou've shown ?n this case. It was simply seriously generous oof y?u to present exensively ?hat a lot of folks ?ould've offered for an ebook in ma?ing some profit for their own end, mostly consider?ng the f?ct that you might have ?one ?t ?n case ?o? decided. Those tips likewise acted t? become ? goo? way to realize th?t many people h?ve a simi?ar fervor the same as my personal own t? find out l?ts mor? pertaining to this problem. I am ce?tain there ar? millions off m?re fun situations ahead foor people who look over yo?r blog post. ? must show my appreciation to yyou ju?t for rescuing mee fr?m th?s type of challenge. ?s a result of surfing thro?ghout the search engines ?nd obtaining ideas th?t wer? not powerful, I figured m? life ?as over. Being alive m?nus the answers to the issues yo? hae fixed through your goood blog post i? a critical ?ase, ?nd the ?ind that w?uld have adversely affecte? my enti?e careewr if I had not noticed your web site. That skills ?nd kindness ?n touching all ar?as wa? valuable. ? am not ?ure what I woul?'ve done if I hadn't discovered ?uch a step l?ke this. I'm ?ble to ?t thi? poinjt l?ok forward to m? future. Th?nks a ?ot ?ery m?ch for the specialized ?nd ?ensible help. I will not bbe reluctant t? suggest your blog tto ?nybody whho desires tips ?n this ?roblem. ? simply ?anted to post a ?rief message to express gratitude t? you for those marvelous informaation yo? are sh?wing on this website. M? time consuming internet ?ook up has at the end of the day been rewarded w?th incredibly good knowleedge t? exchange w?th my close friends. I 'd declare th?t many ?f ?s visitors ar? ?ndoubtedly fortunate t? dwell ?n a fine ?lace with v?ry many perfect people ?ith valuable ideas. ? feel rather fortunate t? have encountered you? entire website page and loo? forward t? really more brilliant times reading here. Thanks ag??n fo? a lot of things. ?hanks so much for providing individuals with remarkably superb chance t? discover im?ortant secrets fr?m this web site. It'? alway? ?o pleasurable ?nd ?lso fuill ?f amusement f?r me personally and my office fellow workers t? visit yohr site the equivalent ?f three timws ?n a week to ?ead the fressh things yyou hav?. ?ot to mention, I ?m u?ually motivated consid?ring the astounding pointers served ?y you. Som? 3 ideas inn this article are surely the finest we ha?e ?ll ha?. I wish to get ?cross m? affection fo? your generosity supporting women whoo ?ctually need he?? ?n that situation. ?our very own commitment to gettting the solution all through appeared to be wonderfully functional ?nd has truly helprd womjen mu?h like me t? reach their objectives. ??ur personal invaluable publication m?ans tgis much ? person l?ke me and s?bstantially more to my mates. Many thanks; from e?ch one of us. I not to mention my buddies came examining the b?st techniques f?und on the website ?nd aall of ? sudden developed a terribl suspicion I ne?er thanked the web site owner f?r them. All the boys are actually consequ?ntly very interested to reazd through thm and now have ?n actuality bee tapping ?nto those things. I apppreciate you f?r indsed being so accommodating as well as f?r figuring ?ut varieties ?f useful thing? mo?t people are rrally needing t? discover. ?y honest apologes f?r not expressing appreciation tto y?u sooner. I'm just commenting t?? ?et yyou understand what a excellent encounter my girl h?d studying your site. ?he picked ?p t?? manny things, which included what it'? ?ike to have a wonderful teaching nature t? h?ve other folks clearly learn about sseveral ver? confusing subject matter. ?ou undo?btedly did m??e thyan my expected ?esults. M?ny th?nks f?r presenting th?s? informative, trusted, revealing ?s well as easy thoughts ?n yo?r topic t?o Lizeth. I simply desired tto thank yyou ?o much once again. I am not surre th? thing? that I could possi?ly have use? ?n the absence off tthose creatie concepts contributed ?y you oon sufh theme. ?his has been ? very intimidating setting in my circumstances, however , considering ? new professional style y?u solved that too? me to weep ith fulfillment. ?ow ? am thankful foor your sujpport and in add?tion expect you rea?ly kno? whaqt an amazing job yoou are putting ?n training some ?ther people u?ing yo?r web blog. I ?now th?t you have never encountered any of us. My husband and i feelt q?ite contented that Raymond managed t? conclude his inquiry ?hile using the ideas he got ?hile ?sing th?

    Friday, November 3, 2017 6:44 AM

Animate deja un comentario!!!

Eres un humano?

Últimos Tweets

Contáctanos

  • Dirección: Plutarco Elias Calles 243, Granjas México, Iztacalco, DF.

  • Teléfono:55-2712-3820 o 55-4164-9484

  • Email: info@developerji.com