I've spent the entire day trying to convert this VB.Net code into SQL script. The goal is to remove the VB code and switch to stored procedures:
Dim hashmap = getHashMap()
Dim x = hashmap.Where(Function(i) Not i.Name.ToLower.Contains("john"))
Dim y = x.GroupBy(Function(i) i.City)
Dim z = y.Select(Function(grp) grp.First()).ToList
So far, I've translated everything but the last line (Dim z = y.Select(Function(grp) grp.First()).ToList
):
SELECT City FROM hashmap WHERE LOWER(Name) NOT LIKE '%john%' GROUP BY City