Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

query

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
knaren1975
Asked:
knaren1975
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you mean, take all until first space, if any?
select left(yourfield, charindex(' ', yourfield + ' ') - 1) from yourtable

Open in new window

0
 
knaren1975Author Commented:
Great it worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now