Chandu yadav has Published 1091 Articles

How to select only non - numeric values from varchar column in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

You need to use REGEXP for this. The syntax is as followsSELECT *FROM yourTableName WHERE yourColumnName REGEXP '[a-zA-Z]';To understand the concept, let us create a table. The query to create a table is as followsmysql> create table SelectNonNumericValue    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ... Read More

Get the first element in an array and return using MongoDB Aggregate?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

2K+ Views

Use $unwind operator with $project for to get the first element in an array. Let us create a collection with documents. Following is the query>db.getFirstElementInArrayDemo.insertOne({"StudentName":"John", "StudentSubject":["MongoDB", "Python", "MySQL"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9c41292d6669774125244e") } >db.getFirstElementInArrayDemo.insertOne({"StudentName":"Chris", "StudentSubject":["Java", "C"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9c413f2d6669774125244f") ... Read More

Instruction cycle in 8085 Microprocessor

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

5K+ Views

The Program and data which are stored in the memory, are used externally to the microprocessor for executing the complete instruction cycle. Thus to execute a complete instruction of the program, the following steps should be performed by the 8085 microprocessor.Fetching the opcode from the memory;Decoding the opcode to identify ... Read More

Can I query on a MongoDB index if my query contains the $or operator?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

206 Views

Yes, you can do that. First, you need to create an index and then use explain(). Let us first create a MongoDB index. Following is the query:> db.indexOrQueryDemo.ensureIndex({"First":1});This will produce the following output{    "createdCollectionAutomatically" : false,    "numIndexesBefore" : 2,    "numIndexesAfter" : 3,    "ok" : 1 }The ... Read More

Time Functions in Python?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

15K+ Views

Python provides library to read, represent and reset the time information in many ways by using “time” module. Date, time and date time are an object in Python, so whenever we do any operation on them, we actually manipulate objects not strings or timestamps.In this section we’re going to discuss ... Read More

8085 program to multiply two 8 bit numbers using logical instructions

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

2K+ Views

In this program we will see how to multiply using logical operators.Problem StatementWrite 8085 Assembly language program to multiply two 8-bit numbers using logical operators.DiscussionWe are assuming the first number is in register B, and second number is in register C, and the result must not have any carry.Here we ... Read More

LongStream boxed() method in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

264 Views

The boxed() method of the LongStream class returns a Stream consisting of the elements of this stream, each boxed to a Long.The syntax is as follows.Stream boxed()Here, Stream represents a sequence of elements. To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create an IntStream and add some ... Read More

C++ Program to Compare Binary and Sequential Search

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

604 Views

Binary Search and Sequential or Linear Search both are used in computer programming to search an element. The time complexity of Binary Search is O(log(n)) and Sequential Search is O(n).AlgorithmBegin    Algorithm for Binary Search:    BinarySearch() function with ‘arr’ the array of data and ‘n’ the number of values, ... Read More

Exclude certain columns from SHOW COLUMNS in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

362 Views

Let us first create a demo tablemysql> create table excludeCertainColumnsDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(100),    -> StudentAge int,    -> StudentMarks int,    -> StudentAddress varchar(200)    -> ); Query OK, 0 rows affected (0.50 sec)Now you can ... Read More

What is the difference between include action and include directive in JSP?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

include action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.

Advertisements