Return the Greater of The Fields Last Column in SQL

I am faced with the problem of returning the greater of the two values in the “entryId” field, that precedes the “|” mark. Each entryId field will have different numbers depending on the day, and I need to select the values that are the same, and have a higher number that precedes the “|” mark. For example, I will need to select entryId = ‘800181373149|3’, ‘800181373112|3’, ‘800181373186|3’ and not ‘800181373186|1’ Here is what my code is: SELECT [entryId] ,[startDate] ,[endDate] FROM [data] WHERE entryId LIKE ‘8001813731%’; Here is the output: entryId startDate endDate…