Ankith Reddy has Published 1070 Articles

SELECT not null column from two columns in MySQL?

Ankith Reddy

Ankith Reddy

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

8K+ Views

There are lots of ways to select NOT NULL column from two columns. The syntaxes are as follows:Case 1: Use IFNULL() function.The syntax is as follows:SELECT IFNULL(yourColumnName1, yourColumnName2) as anyVariableName from yourTableName;Case 2: Use coalesce() function.The syntax is as follows:SELECT COALESCE(yourColumnName1, yourColumnName2) as anyVariableName from yourTableName;Case 3: Use CASE statement.The ... Read More

How to make back button twice to close an activity in Android?

Ankith Reddy

Ankith Reddy

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

675 Views

Sometimes we click back button unintentionally, When you click on a back button it will close your application or will go back to another activity. To avoid this problem, This example demonstrates how to make back button twice to close an activity.Step 1 - Create a new project in Android ... Read More

What is WAN accelerator?

Ankith Reddy

Ankith Reddy

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

460 Views

A wide area network accelerator (WAN accelerator) is a hardware component, a software, or an appliance executing in a virtualized environment that provides caching and optimization of WAN services. A WAN accelerator is also called a WAN optimizer or application accelerator.Working PrincipleA WAN accelerator provides services to speed up information ... Read More

MySQL Select Rows where two columns do not have the same value?

Ankith Reddy

Ankith Reddy

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

969 Views

You can use != operator from MySQL for this. The syntax is as follows:SELECT *FROM yourTableName WHERE yourColumnName1 !=yourColumnName2 OR (yourColumnName1 IS NULL AND yourColumnName2IS NOT NULL) OR (yourColumnName2 IS NULL AND yourColumnName1 IS NOT NULL);To understand the above syntax, let us create a table. The query to create a ... Read More

The Data Link Layer Frame and Frame Fields

Ankith Reddy

Ankith Reddy

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

16K+ Views

Data Link Layer FrameA frame is a unit of communication in the data link layer. Data link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too large, then the packet may be divided into small sized frames. At receiver’ end, ... Read More

Execute INSERT if table is empty in MySQL?

Ankith Reddy

Ankith Reddy

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

2K+ Views

You can execute insert if table is empty with the help of subquery. For that, work on not exists condition with subquery.The below syntax will work only when your table is empty. If your table is not empty then it will not insert the record. The syntax is as follows:INSERT ... Read More

Automatic Repeat reQuest (ARQ)

Ankith Reddy

Ankith Reddy

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

10K+ Views

Automatic Repeat ReQuest (ARQ) is a group of error – control protocols for transmission of data over noisy or unreliable communication network. These protocols reside in the Data Link Layer and in the Transport Layer of the OSI (Open Systems Interconnection) reference model. They are named so because they provide ... Read More

How to use the front camera in Swift?

Ankith Reddy

Ankith Reddy

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

892 Views

To use the front camera in swift we first need to get a list of cameras available in the device we are using. In this article we’ll see how to get the list of devices and then check if the front camera is available or not. We’ll do it in ... Read More

Change value from 1 to Y in MySQL Select Statement using CASE?

Ankith Reddy

Ankith Reddy

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

103 Views

You can use CASE from MySQL to change value from 1 to Y. Let us first create a table. The query to create a table is as follows:mysql> create table changeValuefrom1toY    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> isValidAddress tinyint(1),    -> PRIMARY KEY(Id)   ... Read More

MySQL - Changing year of dates from 2020 to 2011?

Ankith Reddy

Ankith Reddy

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

311 Views

You can change year of dates from 2020 to 2011 using SUBDATE() with INTERVAL of 9 year because there is a difference of 9 years between 2020 to 2011.The syntax is as follows:UPDATE yourTableName SET yourDateColumnName=SUBDATE(yourDateColumnName, INTERVAL 9 YEAR);To understand the above syntax, let us create a table. The query ... Read More

Advertisements