Jump to content

query help


Recommended Posts

Posted

empid

------

11222,23,94

110,22222,111

12,1990000,1000

 

I need to get only values before comma(,)

11222

110

12

 

 what function I can use in sql server

 

 

Posted

use CHARINDEX(),

look for comma, and print the values before it.

Posted
4 minutes ago, Spartan said:

use CHARINDEX(),

look for comma, and print the values before it.

Charindex worked baa google chesa.

Posted

select substrin (empid,0,charindex(',',empid) from table vachindhi 

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...