AmitDiwan has Published 10744 Articles

Return similar names from different columns with distinct space allocations in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:57:26

112 Views

For this, use LTRIM() and RTRIM(), since the names are similar but have different left and right space allocations. For example, “ John “ and “John”.Let us first create a table −mysql> create table DemoTable614 (EnterName varchar(100), ReennterName varchar(100)); Query OK, 0 rows affected (0.97 sec)Insert some records in the ... Read More

Perform MySQL update with AND operator

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:53:51

112 Views

Let us first create a table −mysql> create table DemoTable613 (Id int, Age int, isMarried tinyint(1)); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable613 values(100, 29, 0); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable613 values(200, ... Read More

How to create conditions in a MySQL table with multiple columns?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:48:29

363 Views

For conditions, use IF(). Following is the syntax −IF(yourCondition, trueStatement, falseStatement);Let us first create a table −mysql> create table DemoTable612 (Number1 int, Number2 int, Score int); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable612 values(10, 20, 1000); Query OK, ... Read More

Querying age from DOB in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:15:13

313 Views

Let us first create a table −mysql> create table DemoTable611 (DOB date); Query OK, 0 rows affected (0.99 sec)Insert some records in the table using insert command −mysql> insert into DemoTable611 values('1996-04-21'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable611 values('2001-01-31'); Query OK, 1 row affected (0.16 ... Read More

Selecting the top occurring entries in MySQL from a table with duplicate values?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:13:01

128 Views

Let us first create a table −mysql> create table DemoTable610 (SubjectName varchar(100)); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable610 values('MySQL'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable610 values('Java'); Query OK, 1 row affected (0.23 ... Read More

MySQL query to remove first digit?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:05:05

787 Views

For this, use SUBSTR(). Following is the syntax −update yourTableName set yourColumnName=substr(yourColumnName, 2);Let us first create a table −mysql> create table DemoTable607 (Value varchar(100)); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable607 values('83967364'); Query OK, 1 row affected (0.17 ... Read More

MySQL ORDER BY with EXPLAIN command

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 13:02:12

152 Views

Let us first create a table −mysql> create table DemoTable606 (Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100)); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable606(FirstName) values('John'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable606(FirstName) ... Read More

HTML DOM Input Reset form property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 12:59:34

245 Views

The HTML DOM Input Reset form property is used for returning the form reference that contains the given reset button. If the reset button is outside the form then it will simply return NULL. This property is read-only.SyntaxFollowing is the syntax for input Reset form property.resetObject.formExampleLet us look at an ... Read More

Format date to display month names with the entire date in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 12:57:43

146 Views

For this, you can use DATE_FORMAT(). Let us first create a table −mysql> create table DemoTable605 (DueDate date); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable605 values('2019-01-21'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable605 values('2019-02-23'); ... Read More

HTML DOM Input Reset disabled property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 12:55:57

230 Views

The HTML DOM Input reset disabled property is used for setting or returning if the reset button should be disabled or not. It uses boolean values, with true representing the reset button should be disabled and false otherwise. The disabled property is set to false by default. The disabled element ... Read More

Advertisements