Solved

sql server query

Posted on 2016-09-07
4
53 Views
Last Modified: 2016-09-07
I am not sure how to create an sql server query that will return the strings that have no numeric characters in them and then another that has ability to return mixed i.e A'4'.

The field word only holds one word.

so:
'0'
'001001101'
'F1'
'1f'
 would not be returned

words :

'sweeper'
'bhp'

would be returned the field name is word from Tblwords
0
Comment
Question by:PeterBaileyUk
  • 3
4 Comments
 

Author Comment

by:PeterBaileyUk
ID: 41787404
ive just tried:
use Dictionary
select word
from TblWords
where word is not null and word not like'%[0-9]'
group by word
order by word

Open in new window


thats giving me where there is mixture of alpha numeric.

thats one part done

the alpha characters only i cannot word out can i do A-z ?
0
 
LVL 46

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 41787405
You can use PATINDEX:
SELECT *
FROM tblWords
WHERE PATINDEX('%[0-9]%',Word)=0

Open in new window

0
 

Author Comment

by:PeterBaileyUk
ID: 41787407
and failed with this:
use Dictionary
select word
from TblWords
where word is not null and word like'[A-Z][a-z]'
group by word
order by word

Open in new window

0
 

Author Closing Comment

by:PeterBaileyUk
ID: 41787408
thank you Vitor
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now