Click here to Skip to main content
15,070,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Table Cell messagebody contains

"<p>FAISAL MAJEED , Tomorrow will be a holiday due to STRIKE.</p>"

"i want to remove <p> and </p> tags"

SQL
select REPLACE(messagebody,'<p>','') from message


this query is removing only <p> tag but not </p> tag, please help to remove one more tag </p>
Posted
Updated 13-Feb-14 21:40pm
v6
Comments
CoderPanda 14-Feb-14 3:01am
   
Sorry, question isn't clear.
[no name] 14-Feb-14 3:25am
   
i want to remove HTML tags in SELECT statement and display it

1 solution

This is a very poor way to do it...SQL is really not good at this. But...
SQL
SELECT REPLACE (REPLACE(messagebody,'<p>',''), '</p>', '') FROM message
will do it.
See what I mean?
High level language filtering (or even regex) is a better idea.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900