In SQL, how to limit the number of rows after ordering it in Oracle DB?

  • How-Tos FAQs
  • December 16, 2018
Supercharge Your Snowflake SQL
with Datameer's
Data Transformation

We can perform ‘Like’ operations in MongoDB using regular expressions. In fact, regular expressions are more powerful than the Like operator.

Let us consider the following collection:

db = {
  "fruits": [
                {"name": "apple" },
                { "name": "pineapple" },
                { "name": "orange" },
                { "name": "banana"}
              ]
}

For Like ‘%apple%’:

db.fruits.find({  name: {    $regex: "apple"  }})
#Output
apple, pineapple

For Like ‘a%’:

db.fruits.find({  name: {    $regex: "^a"  }})
#Output
apple

For Like ‘%e’:

db.fruits.find({  name: {    $regex: "e$"  }})


#Output
apple, pineapple, orange

Up Next:

Read How to convert DATETIME value to VARCHAR value in SQL server?

Related Posts

SQL FAQ Feat

How to avoid SQL injection in PHP?

  • How-Tos FAQs
  • December 15, 2018