Skip to content

Tag: sql-server

sql extract multiple words from one cell

I have a column that has some text written in it, including serial numbers. What I want to do is to extract the serial numbers , when they exists. I managed to extract only the first one. This works great if there is only one SN in it, otherwise the rest are not shown. For example I have this: I

Retrieving the latest result in sql

I have written sql query that is pulling agreements data. I need to pull the latest agreement. The latest version is determined based on the most recent version. As you can see currently my query is …

SQL to get whole words till end from the keyword

Consider I have text from the field (notes) as below: I want a SQL query which fetches the link part only. That is to find keyword http and print till the last. Output: Also if the text field doesnt have any link, can we print NA? Answer For SQL Server you can consider this below logic- For MySQL- In case