Solved

SQL Query

Posted on 2009-07-09
4
203 Views
Last Modified: 2012-05-07
Hey Experts!
I need to write a SQL query to filter out some records. I need all records that start with "MED" and are 8 characters long.
 
something along the lines of:
 
select * from TABLE where len(RECORD) = 8 and Begins with "MED"
 
Urgent! Thanx!!!

Open in new window

0
Comment
Question by:calbackup
  • 3
4 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 24820384
select * from TABLE where len(RECORD) = 8 and RECORD like '%MED?%'
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24820396
select * from TABLE where len(RECORD) = 8 and RECORD like 'MED%'
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 24820399
RECORD is nothing but you filed name that you want to check for length and start characters
0
 

Author Closing Comment

by:calbackup
ID: 31601945
Thanx dude! worked like a charm
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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