Select Names NOT Starting And NOT Ending With Vowels in MS SQL Server

Introduction

Sometime we may need to select the column results that the string not starting and not ending with Vowels. In this article, We will have a look, How to select the columns results not starting and not ending with Vowels. In our previous articles we discussed how to select columns results 

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]
Fig.1 Entire Table Results

Now lets select student names not starting and not ending with Vowels.

SELECT [StudentId]
      ,[FirstName]
      ,[LastName]
      ,[RegistrationNumber]
      ,[Degree]
      ,[CreatedDate]
      ,[CreatedBy]
  FROM [PracticalWorks].[Details].[StudentDetails] 
  WHERE [FirstName] NOT LIKE '[aeiou]%' 
  AND   [FirstName] NOT LIKE '%[aeiou]'

The above query results as,

Fig.2 Student Names NOT Starting and NOT Ending with Vowels

Conclusion

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

Response

  1. […] Select Names NOT Starting And NOT Ending With Vowels in MS SQL Server […]

    Like

Leave a reply to Select Names NOT Starting with Vowels in MS SQL Server – Learn With Sundar Cancel reply