Nishtha Thakur has Published 564 Articles

How to SELECT min and max value from the part of a table in MySQL?

Nishtha Thakur

Nishtha Thakur

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

333 Views

To select min and max value from the part of a table in MySQL, use the following syntax −select min(yourColumnName) as yourAliasName1, max(yourColumnName) as yourAliasName2 from (select yourColumnName from yourTableName limit yourLimitValue) tbl1;Let us first create a table. Following is the query −mysql> create table MinAndMaxValueDemo    -> (   ... Read More

Loop through all MongoDB collections and execute query?

Nishtha Thakur

Nishtha Thakur

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

646 Views

First of all, you need to get your collection with the help of getCollectionNames().The database name is “test”. Let us loop through all MongoDB collections and execute the query. The query is as follows −> db.getCollectionNames().forEach(function(collectioNameDemo) ... {    ... var nextDemo = db[(collectioNameDemo) ].find().sort({_id:-1}).limit(1);    ... if (nextDemo.hasNext())   ... Read More

How to use unixepoch in Android sqlite?

Nishtha Thakur

Nishtha Thakur

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

90 Views

Before getting into an example, we should know what sqlite database in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built-in SQLite database implementation. SQLite supports all the relational database features. In order to access ... Read More

How to set delay for MySQL trigger/procedure execution?

Nishtha Thakur

Nishtha Thakur

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

3K+ Views

To set delay, you can use SLEEP(). Let us implement SLEEP() in the procedure execution delay.First, we will create a stored procedure −mysql> DELIMITER // mysql> CREATE PROCEDURE delayInMessage()    -> BEGIN    -> SELECT SLEEP(20);    -> SELECT "AFTER SLEEPING 20 SECONDS, BYE!!!";    -> END    -> // ... Read More

How to align views at the bottom of the screen in iOS

Nishtha Thakur

Nishtha Thakur

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

1K+ Views

The recommended way and the modern way is to do using constraint. We will be using constraint to align the views at the bottom of the screen.Step 1: Open Xcode → New Projecr → Single View Application → Let’s name it “ViewAlignment”I’ll be using UIView, but you can use any ... Read More

How append string with select command in Android sqlite?

Nishtha Thakur

Nishtha Thakur

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

146 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

How to get city information from Network provider in android?

Nishtha Thakur

Nishtha Thakur

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

219 Views

This example demonstrates about How to get city information from Network provider in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     ... Read More

How to use equals () in Android textview?

Nishtha Thakur

Nishtha Thakur

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

762 Views

This example demonstrate about How to use equals () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step  − Add the following code to res/layout/activity_main.xml.           ... Read More

Check that a table exists in MySQL?

Nishtha Thakur

Nishtha Thakur

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

689 Views

In order to check a table exists in MySQL, you can use INFORMATION_SCHEMA.TABLES. Let us first create a table −mysql> create table Client_information    -> (    -> Id int,    -> Name varchar(10)    -> ); Query OK, 0 rows affected (0.48 sec)Following is the query to insert some ... Read More

MongoDB query condition on comparing 2 fields?

Nishtha Thakur

Nishtha Thakur

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

305 Views

To query condition on comparing 2 fields, use the following syntax −db.yourCollectionName.find( { $where: function() { return this.yourFirstFieldName < this.yourSecondFieldName } } ).pretty();To understand the syntax, let us create a collection with the document. The query to create a collection with a document is as follows −> db.comparingTwoFieldsDemo.insertOne({"StudentName":"John", "StudentAge":21, "StudentMathMarks":99, ... Read More

Advertisements