Chandu yadav has Published 1090 Articles

How to find capital letters with Regex in MySQL?

Chandu yadav

Chandu yadav

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

523 Views

You can use REGEXP BINARY for thisselect *from yourTableName where yourColumnName REGEXP BINARY '[A-Z]{2}';Let us first create a tablemysql> create table FindCapitalLettrsDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentFirstName varchar(20)    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records ... Read More

Get the average of an entire field using the aggregation framework in MongoDB?

Chandu yadav

Chandu yadav

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

153 Views

You can use aggregate() method for this. Let us first create a collection with documents> db.averageAggregationDemo.insertOne({"PlayerGameScore":45}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ed66bd628fa4220163b95") } > db.averageAggregationDemo.insertOne({"PlayerGameScore":55}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ed671d628fa4220163b96") } > db.averageAggregationDemo.insertOne({"PlayerGameScore":65}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ed676d628fa4220163b97") } ... Read More

What is a pageContext Object in JSP?

Chandu yadav

Chandu yadav

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

1K+ Views

The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page.This object is intended as a means to access information about the page while avoiding most of the implementation details.This object stores references to the request and response objects for ... Read More

Query MongoDB for a datetime value less than NOW?

Chandu yadav

Chandu yadav

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

722 Views

You can use $lte operator along with new Date() for this. Let us first create a collection with documents>db.dateTimeValueLessThanNowDemo.insertOne({"CustomerName":"Larry", "CustomerProductName":"Product-1", "ArrivalDate":new ISODate("2017-01-31")}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca1e8ab66324ffac2a7dc59") } >db.dateTimeValueLessThanNowDemo.insertOne({"CustomerName":"Mike", "CustomerProductName":"Product-2", "ArrivalDate":new ISODate("2019-04-01")}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca1e8c166324ffac2a7dc5a") } >db.dateTimeValueLessThanNowDemo.insertOne({"CustomerName":"Chris", "CustomerProductName":"Product-3", "ArrivalDate":new ISODate("2019-03-31")}); ... Read More

8086 program to subtract two 16 bit BCD numbers

Chandu yadav

Chandu yadav

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

1K+ Views

In this program we will see how to subtract two 16-bit BCD numbers.Problem StatementWrite 8086 Assembly language program to subtract two 16-bit BCD numbers stored in memory offset 500H – 501H and 502H – 503H.DiscussionHere we are adding the 16-bit data byte by byte. At first we are subtracting lower ... Read More

What is a page object in JSP?

Chandu yadav

Chandu yadav

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

433 Views

This object is an actual reference to the instance of the page. It can be thought of as an object that represents the entire JSP page.The page object is really a direct synonym for the this object.

Set Ennead value in JavaTuples

Chandu yadav

Chandu yadav

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

122 Views

To set Ennead value in Java, you need to use the setAtX() method. Here, X represents the index wherein you need to set the value i.e. for index 1, use setAt1() method. Set the value as the parameter value of the method.Let us first see what we need to work ... Read More

Using find() to search for nested keys in MongoDB?

Chandu yadav

Chandu yadav

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

821 Views

For find() to search for nested keys in MongoDB, you can use dot(.) notation. Following is the syntaxdb.yourCollectionName.find({"yourOuterFieldName.yourInnerFieldName":"yourValue"}).pretty();Let us first create a collection with documents:>db.searchForNestedKeysDemo.insertOne({"ClientName":"Larry", "ClientAge":28, "ClientExtra Details":{"isEducated":true, "CountryName":"US"}}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca20e8b66324ffac2a7dc64") } >db.searchForNestedKeysDemo.insertOne({"ClientName":"Chris", "ClientAge":29, "ClientExtra Details":{"isEducated":false, "CountryName":"UK"}}); {    "acknowledged" : true,   ... Read More

Is there a way to convert Integer field into Varchar without losing data in MySQL?

Chandu yadav

Chandu yadav

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

1K+ Views

You can use ALTER command to convert Integer into Varchar. Let us first create a tablemysql> create table DemoTable (    UserId int,    UserFirstName varchar(20),    UserLastName varchar(20),    UserAge int ); Query OK, 0 rows affected (0.73 sec)Now check the description of table using DESC command:mysql> desc DemoTable;This ... Read More

How to Drop MySQL Table using Java?

Chandu yadav

Chandu yadav

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

280 Views

Let us first create a table in a database. The query to create a table is as followsmysql> create table customerDetails    -> (    -> CustomerId int,    -> CustomerName varchar(30)    -> ); Query OK, 0 rows affected (0.56 sec)Now display all tables from the database in order ... Read More

Advertisements