AmitDiwan has Published 10744 Articles

MySQL query to calculate sum from 5 tables with a similar column named “UP”?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 08:02:41

506 Views

For this, use UNION ALL along with SUM(). Let us create 5 tables −mysql> create table DemoTable1977    (    UP int    ); Query OK, 0 rows affected (0.00 sec) mysql> insert into DemoTable1977 values(10); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1977 values(20); Query OK, ... Read More

jQuery replaceAll() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 08:01:41

247 Views

The replaceAll() method in jQuery is used to replace selected elements with new HTML elements.SyntaxThe syntax is as follows −$(content).replaceAll(selector)Above, the content parameter is the content to insert, whereas the selector specifies which elements to be replaced.ExampleLet us now see an example to implement the jQuery replaceAll() method − Live Demo ... Read More

Update a column A if null, else update column B, else if both columns are not null do nothing with MySQL

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:59:15

2K+ Views

For this, use IF() with IS NULL property. Let us first create a table −mysql> create table DemoTable1976    (    FirstName varchar(20),    LastName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1976 values('John', 'Doe'); Query ... Read More

jQuery Effect show() Method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:58:16

363 Views

The show() method in jQuery is used to display the hidden element.SyntaxThe syntax is as follows −$(selector).show(speed, easing, callback)Above, the parameter speed is the speed of the show effect, whereas easing is the speed of the element in different points of the animation. The callback function is a function that ... Read More

MySQL query to count all the column values from two columns and exclude NULL values in the total count?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:56:49

228 Views

Let us first create a table −mysql> create table DemoTable1975    (    StudentName varchar(20),    StudentMarks int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1975 values('John', 45); Query OK, 1 row affected (0.00 sec) mysql> insert ... Read More

Dynamic SQL to get a parameter and use it in LIKE for a new table created inside a stored procedure

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:54:52

516 Views

For this, use prepared statement. Let us first create a table −mysql> create table DemoTable1973    (    StudentId int,    StudentName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1973 values(101, 'Chris'); Query OK, 1 row ... Read More

MySQL query to get a specific row from rows

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:52:57

452 Views

Let us first create a table −mysql> create table DemoTable1972    (    Section char(1),    StudentName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1972 values('D', 'Chris'); Query OK, 1 row affected (0.00 sec) mysql> insert ... Read More

MySQL procedure with SELECT to return the entire table

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:49:56

3K+ Views

Let us first create a table −mysql> create table DemoTable1971    (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentName varchar(20),    StudentPassword int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1971(StudentName, StudentPassword) values('John', '123456'); ... Read More

jQuery element ~ siblings Selector

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:46:45

155 Views

The element ~ siblings selector in jQuery is used to select all elements that are siblings of the specified "element".SyntaxThe syntax is as follows −("ele ~ siblings")Above, the parameter ele is any valid selector, whereas siblings are the siblings of the ele parameter.ExampleLet us now see an example to implement ... Read More

Order by numeric value from string records separated by numbers like CSE 15, CSE 11, etc.?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:45:16

105 Views

Let us first create a table −mysql> create table DemoTable1969    (    BranchCode varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1969 values('CSE 101'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1969 values('CSE ... Read More

Advertisements