Q&A about the site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure
DECLARE @str VARCHAR(50) SET @str = 'https://aws.amazon.com/marketplace/ppprodview-' SELECT case when LEN(@str) - LEN(REPLACE(@str, '/', '')) < 5 then @str else SUBSTRING(@str, 0, CHARINDEX('/', @str, CHARINDEX('/', @str, CHARINDEX('/', @str, CHARINDEX('/', @str, CHARINDEX('/', @str, 0) + 1) + 1) + 1) + 1)) end