• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • 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

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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