Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Query Help

Posted on 2009-04-30
3
Medium Priority
?
215 Views
Last Modified: 2012-05-06
How do I create a query that only returns distinct values from a field called tireType with values such as:

Truck / SUV - SKU=BF026614
Truck / SUV - SKU=BF5555
Hi-Performance A/S - SKU=BF027209
Ultra High Performance - SKU=BF037036

I would like the query to only this:

Truck / SUV
Hi-Performance A/S
Ultra High Performance

TIA,

Terry
0
Comment
Question by:splendorx
3 Comments
 
LVL 15

Expert Comment

by:MNelson831
ID: 24271776
Select distinct tireType from MyTableName
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 total points
ID: 24271787
Hello splendorx,

SELECT LEFT (urColumn , PATINDEX('%- SKU%',urColumn)-1  )
from urTable

Regards,

Aneesh
0
 
LVL 1

Author Closing Comment

by:splendorx
ID: 31576513
Thanks for your help!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

810 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