Results 1 to 6 of 6

Thread: search substring (same format) from one column

Hybrid View

  1. #1
    Join Date
    Sep 2002
    Posts
    5,938
    Is it better to get table normalized?

  2. #2
    Join Date
    Sep 2005
    Posts
    168
    declare @str varchar(200)

    set @str='1111streetuniversityapp3h1p2w3montrealquebec canada'

    select reverse(substring(reverse(@str), patindex('%[0-9][a-z][0-9][a-z][0-9][a-z]%',reverse(@str)),6))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •