Chandu yadav has Published 1163 Articles

How can I add a new column which counts the number of rows as serial number in MySQL?

Chandu yadav

Chandu yadav

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

1K+ Views

To add a new column that counts the number of rows as serial number, you can use the global variable in select statement.Let us create a table. The query to create a table is as follows:mysql> create table addColumnToCountAsSerialNumber    -> (    -> Id int,    -> Name varchar(20), ... Read More

Android image scale animation relative to center point?

Chandu yadav

Chandu yadav

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

1K+ Views

This example demonstrate about Android image scale animation relative to center point.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 check edit text's text is email address or not in Android?

Chandu yadav

Chandu yadav

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

201 Views

Before getting into an example, we should know the test scenario. In the login page, usually, we take email id and password from edit text. While taking email id from edit text. we should know, it is the valid format or not.This example demonstrates how to check the edit text's ... Read More

How to make count animation in Android TextView?

Chandu yadav

Chandu yadav

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

828 Views

This example demonstrate about How to make count animation 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 2 − Add the following code to res/layout/activity_main.xml.     In the ... Read More

How to use android date change listener ?

Chandu yadav

Chandu yadav

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

805 Views

Before getting into the example, we should know what is date picker and how does it work in android. The date picker is a subclass of frame layout and it allows to select the date, month and year.This example demonstrates how to use android date change listener.Step 1 − Create ... Read More

How to show shaking / wobble view animation in android?

Chandu yadav

Chandu yadav

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

677 Views

This example demonstrate about How to show shaking / wobble view animation 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 make a countdown timer in Android?

Chandu yadav

Chandu yadav

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

3K+ Views

Before getting into an example, we should know what is a countdown timer in android. Count down timer as simple as we see in watches and mobile phones. we can set count down time after completion of time it will stop and get 0 values.There are four methods are available ... Read More

How to cancel an executing AsyncTask in Android?

Chandu yadav

Chandu yadav

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

1K+ Views

Before getting into example, we should know what is AsyncTask in android. AsyncTask going to do operations/actions in background thread and update on mainthread. While doing background operations on background thread, user can cancel operations by using the following code -AsynTaskExample mAsyncTask = new AsyncTaskExample(); mAsyncTask.cancel(true);This example demonstrate about how ... Read More

In MySQL how to select the top 2 rows for each group?

Chandu yadav

Chandu yadav

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

827 Views

To select the top 2 rows from each group, use the where condition with subquery. Let us create a table. The query to create a table is as follows:mysql> create table selectTop2FromEachGroup    -> (    -> Name varchar(20),    -> TotalScores int    -> ); Query OK, 0 rows ... Read More

Split the left part of a string by a separator string in MySQL?

Chandu yadav

Chandu yadav

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

404 Views

You can use substring_index() function from MySQL to split the left part of a string. The syntax is as follows −SELECT yourColumnName1, .....N, SUBSTRING_INDEX(yourColumnName, ’yourSeperatorSymbol’, 1) as anyVariableName from yourTableName;The value 1 indicates that you can get left part of string. To check the above syntax, let us create a ... Read More

Advertisements