-
UPDATE left _
how can I can update a table ::
I must get all the left part of a columns part1_part2
I dont know how many characters
something like :
UPDATE Users SET Users.Info = left(Users.name, _ ??? or split('_'))
in that case Users.name = part1
thank you
-
what RDBMS?
if it is sql server then you can use LEFT function and CHARINDEX function to do it.
-
yes sorry MS SQL 2000
I must get all the left chars of '_' but I dont know how many
if you know how to do it ?
i must update only the one with a '_' and do nothing for the others
thank you
Last edited by anselme; 12-01-2006 at 12:05 PM.
-
UPDATE Users SET Users.Info = LEFT(Users.name, CHARINDEX('_', Users.name) -1)
WHERE CHARINDEX('_', Users.name) > 0
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|