Sharon Christine has Published 436 Articles

HTML DOM Input Number readOnly Property

Sharon Christine

Sharon Christine

Updated on 01-Jul-2020 07:58:12

108 Views

The HTML DOM input number readOnly property returns and modify whether the input number field is read-only or not in an HTML document.SyntaxFollowing is the syntax −Returning readOnlyobject.readOnlyModifying readOnlyobject.readOnly = true | falseExampleLet us see an example of input number readOnly property − Live Demo    html{   ... Read More

HTML DOM id Property

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 15:36:01

113 Views

The HTML DOM id property returns and allow us to set id of an HTML element.SyntaxFollowing is the syntax −1. Returning idobject.id2. Setting idobject.id=”value”Here, “value” represents the id of an element.ExampleLet us see an example of id property − Live Demo    p{       background-color:#347924;   ... Read More

Swap data between two columns in MySQL?

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 15:06:56

806 Views

To swap data between two columns in MySQL, use the concept of variable. Let us first create a table. Here, we will swap Name1 with Name2 −mysql> create table DemoTable -> ( -> Name1 varchar(100), -> Name2 varchar(100) -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in ... Read More

MySQL stored procedure to return a column value?

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 15:05:27

741 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Id int,    -> Score int    -> ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1, 858858686); Query OK, 1 row affected ... Read More

Add values of two columns considering NULL values as zero in MySQL

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 15:00:17

693 Views

For this, use COALESCE() function from MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> Value1 int, -> Value2 int -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 200); Query OK, ... Read More

How can I get the number of times a specific word appears in a column with MySQL?

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 14:59:08

964 Views

For this, you can use COUNT() function. Let us first create a table −mysql> create table DemoTable    -> (    -> EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> EmployeeName varchar(100)    -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert ... Read More

MySQL query to select top 10 records?

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 14:54:57

10K+ Views

To select top 10 records, use LIMIT in MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> PageNumber text -> ); Query OK, 0 rows affected (2.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Page-1'); Query OK, 1 row ... Read More

Converting table from MyISAM to INNODB in MySQL?

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 14:53:21

144 Views

For this, use ALTER command. Let us first create a table. The default engine is set as“MYISAM” −mysql> create table DemoTable -> ( -> ClientId int NOT NULL AUTO_INCREMENT, -> ClientName varchar(100), -> ClientAge int, -> ClientCountryName varchar(100), -> isMarried boolean, -> PRIMARY KEY(ClientId) -> )ENGINE=MyISAM; Query OK, 0 rows ... Read More

How to search on a MySQL varchar column using a number?

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 14:50:28

199 Views

Use INSERT() function from MySQL. It has the following parameters −ParameterDescriptionstrString to be modifiedpositionPosition where to insert str2numberNumber of characters to replacestr2String to insert into strLet us first create a table −mysql> create table DemoTable    -> (    -> Code varchar(100)    -> ); Query OK, 0 rows affected ... Read More

Order by desc except a single value in MySQL

Sharon Christine

Sharon Christine

Updated on 30-Jun-2020 14:49:46

819 Views

Use ORDER BY and set DESC to order by desc. However, to get all the values except a single value, use the not equal operator.Let us first create a table −mysql> create table DemoTable    -> (    -> Name varchar(100)    -> ); Query OK, 0 rows affected (0.89 ... Read More

Previous 1 ... 3 4 5 6 7 ... 44 Next
Advertisements