I have a table os which contains below data
id name
-- ----
1 windows server 2012 R2
2 windows 2016 SQL
3 Oracle linux 7.5
I need to extract 2012 R2 from windows server 2012 R2 and 2016 SQL from windows 2016 SQL and 7.5 from Oracle linux 7.5
I tried below query but it returns only the number like 2012 and 2016 and 7
SELECT name, substring(name FROM '[0-9]+') FROM os;
For eg How can I extract
2012 R2fromwindows server 2012 R2using postgresql query?
7.5.1or2012 Release 2etc?