Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ignoring html tags in ORDER BY

Status
Not open for further replies.

letimati

Technical User
Feb 3, 2006
36
GB
Hi I have a content table with text in it and i want to order the query by the first letter of the content. Problem is there are some html tags in the content.

Is there a way I can ignore the html tags?

thanks
 
Just read over that myslef and I dont think I have made that clear sorry.

Basically I am wondering if there is a way of using regular expresions after the ORDER BY so i can exclude stuff in <> i.e. html tags.

 
According to ANSI/ISO SQL-99 and later you can have expressions in the ORDER BY clause.

SELECT col1, col2 FROM tab WHERE col2 = 'whatever'
ORDER BY <expression-containing-column-reference>


Note that not all DBMS product support this feature.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top