- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Ankith Reddy has Published 1070 Articles
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
158 Views
You can use $in operator instead of $elemMatch on first level array. The syntax is as followsdb.yourCollectionName.find({yourFieldName:{$in:["yourValue"]}}).pretty();Let us first create a collection with documents>db.firstLevelArrayDemo.insertOne({"StudentName":"Chris", "StudentTechnicalSkills":["Mongo DB", "MySQL", "SQL Server"]}); { "acknowledged" : true, "insertedId" : ObjectId("5ca2360f66324ffac2a7dc71") } >db.firstLevelArrayDemo.insertOne({"StudentName":"Robert", "StudentTechnicalSkills":["C", "J ava", "C++"]}); { "acknowledged" : true, ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
131 Views
The exception object is a wrapper containing the exception thrown from the previous page. It is typically used to generate an appropriate response to the error condition.When you are writing a JSP code, you might make coding errors which can occur at any part of the code. There may occur ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
259 Views
Use CAST() in MAX() to get max id from varchar type and values in numeric. Let us first create a table. Here, we have a column with varchar type −mysql> create table DemoTable ( UserMarks varchar(20) ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
3K+ Views
You can use COALESCE() along with aggregate function MAX() for this.The syntax is as followsSELECT COALESCE(MAX(`yourColumnName`), 0) FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table avoidNullDemo -> ( -> `rank` int -> ); ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
68 Views
The get() method of the AbstractSequentialList class is used to display the element at the specified position in this list.The syntax is as followspublic E get(int index)Here, index is the location from where you want to get the element.To work with the AbstractSequentialList class in Java, you need to import ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
3K+ Views
To query on top N rows in MongoDB, you can use aggregate framework. Let us create a collection with documents> db.topNRowsDemo.insertOne({"StudentName":"Larry", "Score":78}); { "acknowledged" : true, "insertedId" : ObjectId("5ca26eee6304881c5ce84b91") } > db.topNRowsDemo.insertOne({"StudentName":"Chris", "Score":45}); { "acknowledged" : true, "insertedId" : ObjectId("5ca26ef66304881c5ce84b92") } > db.topNRowsDemo.insertOne({"StudentName":"Mike", "Score":65}); { ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
3K+ Views
In this program we will see how to add odd numbers in a given seriesProblem StatementWrite 8086 Assembly language program to add the odd numbers stored in a given series starts from memory offset 501. The size of the series is stored at memory offset 500.DiscussionTo do this task we ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
151 Views
To query an array string for a regexp match, use the following syntaxdb.yourCollectionName.find( { yourFieldName: /yourStartingValue./ } ).pretty();Let us first create a collection with documents> db.queryArrayDemo.insertOne({"StudentFullName":["Carol Taylor", "Caroline Williams", "Claire Brown"]}); { "acknowledged" : true, "insertedId" : ObjectId("5ca2774c6304881c5ce84ba0") } > db.queryArrayDemo.insertOne({"StudentFullName":["John Smith", "Jace Doe", "Jabin Brown"]}); { ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
480 Views
To determine current delimiter in MySQL, use the following syntax\sThe above syntax will let you know about the current delimiter. Let us implement the above syntax.The query is as followsmysql> \sThe following is the output-------------- C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe Ver 8.0.12 for Win64 on x86_64 (MySQL Community Server - GPL) ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
Ankith Reddy
2K+ Views
You can use ORDER BY RIGHT() to ORDER BY last 2 character string.The syntax is as followsselect yourColumnName from yourTableName ORDER BY RIGHT(yourColumnName , 2);To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table OrderByLast2CharactersDemo -> ( ... Read More