Wildcards Examples in SQL

Right now, are going to utilize special cases like (_, %) to control resultSet turned out from the question.

The Common activity in cutting edge virtual products such sites is looking for the specific record from the database. Presently, the database can’t do this without the utilization of these trump cards, however, it will require at any rate one remarkable key to do the looking and imagine a scenario where we don’t have that interesting id.

To take care of this issue, we use special cases, presently what these trump cards do? It takes at least one keys and matches them with records in at least one tables. When something matches the key it will be returned thus.

Presently in the example given beneath, we can perceive how we can undoubtedly utilize these special cases together and get the ideal outcome? Here, we have sham information with us, in that fake information we have compensation now we need to get the pay rates in the scope of twenty thousand, mind you here the paid field in varchar so we can’t utilize math administrators like > or <.

Along these lines, what this will do is it will bring all the records with pay beginning from 2 and completion with 0 having three characters in the middle.

Dummy Data for Test:

Wildcards Examples in SQL

Utilization of Wildcard administrator % and _ (Underscore)

Example 1:

SELECT * FROM 'JustTechReview'.'employee' WHERE SALARY LIKE '2___0';\

Example 2:

SELECT * FROM 'JustTechReview'.'employee' WHERE SALARY LIKE '_2%0';

Example 3:

SELECT * FROM 'JustTechReview'.'employee' WHERE SALARY LIKE '3_%_%_%_%'

Leave a Comment

error: Alert: Content is protected!!