In mysql i have table called user. And it contains data like
user
xyz.abc
123.abc
atr.abc etc.....
I need a query such that output should not contain the names after dot(.)
if you're using SQL Program, i think you mean "MySQL" then you can use the function "CharIndex"
the statment should be something like this
"Select Substring(ColumnName,0,CharIndex('.',ColumnName)) as NewUserID From TableName"
0 is Start Index CharIndex will Return the index number for the '.' and it will be the same the supposed length for the string without the .abc
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.