Select Names Ending With Vowels in MS SQL Server

Introduction

Sometime we may need to select the column results that the string ends with Vowels. In this article, We will have a look, How to select the columns results ending with Vowels. In one of the articles, we discussed how to select names Starting with Vowels, please refer that article here.

Example

As an example, we have a StudentDetails table, first lets select all the results from the table.

SELECT [StudentId]
      ,[FirstName]
      ,[LastName]
      ,[RegistrationNumber]
      ,[Degree]
      ,[CreatedDate]
      ,[CreatedBy]
  FROM [PracticalWorks].[Details].[StudentDetails] 

The above query’s result is as shown below,

Fig.1 Entire Table Result

Now lets select student names ending with Vowels.

SELECT [StudentId]
      ,[FirstName]
      ,[LastName]
      ,[RegistrationNumber]
      ,[Degree]
      ,[CreatedDate]
      ,[CreatedBy]
  FROM [PracticalWorks].[Details].[StudentDetails]  
 WHERE FirstName Like '%[aeiou]'
Fig.2 Names Ending with Vowels
GitHub

The sample T-SQL Statement query is available in GitHub for reference.

Conclusion

In this article we have discussed about selecting the columns results ending with Vowels. I hope you all found this article useful. Please share your feedback in the comment section.

Leave a comment

Website Built with WordPress.com.

Up ↑