[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

query

Posted on 2011-02-23
2
Medium Priority
?
288 Views
Last Modified: 2012-05-11
I have data like this

XXXX
XXXX DESC
YYYYY TEXT
ZZZZZZZZ TREWW

I want out as below

XXXX
XXXX
YYYYY
ZZZZZZZZ

I want query for above using sqlserver 2005
0
Comment
Question by:knaren1975
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 total points
ID: 34959500
you mean, take all until first space, if any?
select left(yourfield, charindex(' ', yourfield + ' ') - 1) from yourtable

Open in new window

0
 

Author Closing Comment

by:knaren1975
ID: 34959519
Great it worked
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

831 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