Solved

sql server query

Posted on 2016-09-07
4
40 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
Comment Utility
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 45

Accepted Solution

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

Open in new window

0
 

Author Comment

by:PeterBaileyUk
Comment Utility
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
Comment Utility
thank you Vitor
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

744 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

12 Experts available now in Live!

Get 1:1 Help Now