sql server - how to split values in SQL -



sql server - how to split values in SQL -

i writting sql script first time , want seperate value contains 2 user id's looks

612831408762037_617540318291146

i want separate these 2 have user_id = 612831408762037 , post_id = 617540318291146 ideas on how shuld approch this?

thanks in advance

please try:

declare @var nvarchar(100)='612831408762037_617540318291146'; select left(@var, charindex('_',@var)-1), right(@var, charindex('_',reverse(@var))-1)

sql sql-server

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -