How convert oracle select function to sql server

have you looked at the answers provided to you here?