AmitDiwan has Published 11365 Articles

How to implement the opposite of INITCAP() functionality with MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 12:10:24

205 Views

The INITCAP() method display the first character in every word in uppercase and rest in lowercase.To implement the opposite functionality, you need to create your own function in MySQL. Here’s the function −mysql> delimiter // mysql> create function convertFirstLetterToLowerAndRemainingToCapital(value varchar(250))    returns varchar(250)    deterministic    begin    declare valueLength ... Read More

HTML DOM Input Range form property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 12:05:07

62 Views

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

Concatenate data from multiple rows using GROUP_CONCAT() in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:57:57

202 Views

Let us first create a table −mysql> create table DemoTable (CountryName varchar(100)); Query OK, 0 rows affected (1.01 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('US'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('AUS'); Query OK, 1 row affected (0.13 ... Read More

HTML DOM Input Range autofocus property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:54:00

80 Views

The HTML DOM input range autofocus property is associated with the HTML element’s autofocus attribute. This property is used for setting or returning if the input range slider should be automatically focused when the page loads or not.SyntaxFollowing is the syntax for −Setting the autofocus property −rangeObject.autofocus = true|falseHere, ... Read More

How can I install or enable innoDB in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:52:16

1K+ Views

In order to enable innoDB in MySQ, you need to work around my.ini file. However, in MySQL version 8, the default storage engine is innoDB. Check the same from my.ini file −You can even set this at the time of table creation −mysql> create table DemoTable    (    StudentId ... Read More

HTML DOM Input Radio value Property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:48:05

111 Views

The HTML DOM Input radio value property is associated with the input element having type=”radio” and the value attribute. It is used to return the value of radio button value attribute or to set it.The value property for radio button doesn’t affect the user interface of the website as the ... Read More

HTML DOM Input Radio type property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:43:33

106 Views

The HTML DOM Input radio type property is associated with the input element having its type=”radio”. It will always return radio for the input radio element.SyntaxFollowing is the syntax for radio type property −radioObject.typeExampleLet us look at an example for the radio type property − Live Demo Input radio ... Read More

Get at least x number of rows in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:39:50

110 Views

To get at least x number of rows, you need to use the LIMIT clause. Following is the syntax −select *from yourTableName order by yourColumnName DESC limit yourXNumberOfRows;Let us first create a table −mysql> create table DemoTable (    EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY, EmployeeName varchar(100) ); Query ... Read More

Which is faster, a MySQL CASE statement or a PHP if statement?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:35:45

787 Views

The MySQL CASE statement is faster in comparison to PHP if statement. The PHP if statement takes too much time because it loads data and then process while CASE statement does not.Let us first create a table and work around an example of MySQL CASE statement −mysql> create table DemoTable ... Read More

MySQL query to select records approaching in next 12 hours?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 11:32:13

222 Views

For this, you can use INTERVAL 12 hour using DATE_ADD(). Let us first create a table −mysql> create table DemoTable (DueDateTime datetime); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-07-12 10:50:30'); Query OK, 1 row affected (0.29 sec) ... Read More

Advertisements