Arjun Thakur has Published 1025 Articles

How to count horizontal values on a MySQL database?

Arjun Thakur

Arjun Thakur

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

458 Views

You can use aggregate function COUNT() from MySQL to count horizontal values on a database. Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    FirstValue int,    SecondValue int,    ThirdValue int,    FourthValue int ); Query OK, 0 ... Read More

How to loop thrugh a stored procedure in MySQL?

Arjun Thakur

Arjun Thakur

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

255 Views

Let us see how to loop through a stored procedure in MySQLmysql> DELIMITER // mysql> CREATE PROCEDURE do_WhileDemo(LastValue INT)    -> BEGIN       -> SET @loop = 0;       -> REPEAT          -> SET @loop= @loop+ 1;          -> select ... Read More

How do you define multiple filters in JSP?

Arjun Thakur

Arjun Thakur

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

799 Views

Your web application may define several different filters with a specific purpose. Consider, you define two filters AuthenFilter and LogFilter. Rest of the process will remain as explained above except you need to create a different mapping as mentioned below −    LogFilter    LogFilter           ... Read More

Display all records except one in MySQL

Arjun Thakur

Arjun Thakur

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

551 Views

You can use IN() to display all records except one in MySQL. Let us first create a table −mysql> create table DemoTable (    Id int,    FirstName varchar(20) ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, ... Read More

Why isn't sizeof for a struct equal to the sum of sizeof of each member in C/C++?

Arjun Thakur

Arjun Thakur

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

894 Views

The size of a struct type element taken by sizeof() is not always equal to the size of each individual member. Sometimes the compilers add some padding to avoid alignment issues. So the size may change. The padding is added when a structure member is followed by a member with ... Read More

The add() method of CopyOnWriteArrayList in Java

Arjun Thakur

Arjun Thakur

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

173 Views

Two types of add() methods are available in the CopyOnWriteArrayList class: add(E e) methodTo add elements in CopyOnWriteArrayList class in Java, use the add() method. Here, the element is appended to the end of the list.The syntax is as followsboolean add(E e)Here, the parameter e is the element to be ... Read More

How to add +1 to existing MySQL values?

Arjun Thakur

Arjun Thakur

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

761 Views

Let us see an example and create a table first.mysql> create table Add1ToExistingValue    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into Add1ToExistingValue values(10); Query OK,  1 row affected (0.12 sec) mysql> insert into Add1ToExistingValue values(13); Query OK,  1 row affected (0.15 sec) mysql> insert into Add1ToExistingValue values(15); ... Read More

How to get the maximum value from strings with integers in MySQL?

Arjun Thakur

Arjun Thakur

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

3K+ Views

You can use CAST() with MAX() for this. Since the string is filled with string and integer, fir example, “STU201”, therefore we need to use CAST().Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentBookCode varchar(200) ); Query OK, ... Read More

Interrupts in 8085

Arjun Thakur

Arjun Thakur

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

615 Views

The interrupts in 8085 is classified into the following partsThe data transfer scheme: Executing of 8085 program where the communication process is carried out systematically and is not done directly with the Input Output device. The data transfer can be either in two forms namely parallel or serial respectively.Basic or simple ... Read More

8085 Program to add the contents of N word locations

Arjun Thakur

Arjun Thakur

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

287 Views

Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to add the contents of N word locations.Problem Statement:Write 8085 Assembly language program to add N 16-bit numbers stored into memoryDiscussion:The 16-bit numbers are stored into memory location 8001H onwards. The value of ... Read More

Advertisements