Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Extract only non numeric values from a column of datatype varchar.

Posted on 2006-05-04
4
Medium Priority
?
510 Views
Last Modified: 2012-08-13
I have a table column of varchar type that has a numeric and non numeric values, I want to create a view that gets only the non numeric values from the column.

MyTable
Location List
01
AB
35
02
03
X
09
ABC

I want the view to return Location List with AB, X and ABC values only and leave out all the numeric values.

Thanks!
0
Comment
Question by:srafi78
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 500 total points
ID: 16610323
SELECT [Location List]
FROM MyTable
WHERE PATINDEX('%[0-9]%', [Location List]) = 0
0
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 16610453
SELECT [Location List]
FROM MyTable
WHERE ISNUMERIC([Location List]) = 1

will also pick up decimal numbers and spaces and stuff.
0
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 16610463
Forget my post, I just read the original post properly!
0
 
LVL 8

Author Comment

by:srafi78
ID: 16610574
Thanks! that was very helpful....
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question