Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Query

Posted on 2009-07-09
4
208 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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.​
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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