Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Query

Posted on 2009-07-09
4
Medium Priority
?
221 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
[X]
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
  • 3
4 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 2000 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

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

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

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

721 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