AmitDiwan has Published 10744 Articles

jQuery :visible Selector

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 11:37:23

167 Views

The :visible selector in jQuery is used to select elements that are currently visible.SyntaxThe syntax is as follows −$(":visible")ExampleLet us now see an example to implement the jQuery :visible selector −    $(document).ready(function(){       $("p:visible").css("color", "red");    }); Heading One Heading ... Read More

jQuery :text Selector

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 11:33:57

275 Views

The :text selector in jQuery is used to select input elements with type text.SyntaxThe syntax is as follows −$(":text")ExampleLet us now see an example to implement the jQuery :text selector −    .one {       background-color: green;       color: white;       ... Read More

How to add duplicate varchar values without displaying error in MySQL?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 11:08:27

98 Views

For this, let us see an example and first create a −mysql> create table DemoTable1409    -> (    -> FirstName varchar(20),    -> UNIQUE KEY UN_FirstName(FirstName)    -> ); Query OK, 0 rows affected (0.79 sec)Following is the query to add duplicate varchar −mysql> alter table DemoTable1409 drop index ... Read More

How to include quotes in comma separated column with MySQL?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 11:04:22

886 Views

Let us first create a −mysql> create table DemoTable1407    -> (    -> Name text    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert −mysql> insert into DemoTable1407 values('John, Bob'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1407 ... Read More

Using the entire expression in MySQL WHERE clause?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 11:02:48

139 Views

Let us see an example and create a −mysql> create table DemoTable1406    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert −mysql> insert into DemoTable1406 values(10); Query OK, 1 row affected (0.13 sec) mysql> insert ... Read More

Update all rows in MySQL and remove all the unnecessary whitespaces in and around the string?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 11:01:29

93 Views

To remove unnecessary whitespaces, use TRIM() in MySQL. Let us first create a −mysql> create table DemoTable1405    -> (    -> FirstName varchar(20),    -> LastName varchar(20)    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert −mysql> insert into DemoTable1405 values(' ... Read More

Display month names and year from a column with date records with MySQL

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 10:57:08

483 Views

Let us first create a −mysql> create table DemoTable1619    -> (    -> ArrivalTime datetime    -> ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert −mysql> insert into DemoTable1619 values(now()); Query OK, 1 row affected (0.40 sec) mysql> insert into DemoTable1619 values(curdate()); ... Read More

MySQL query to copy IP address from varchar column to integer in the same table?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 10:55:05

253 Views

For this, you can use INET_ATON(). Let us first create a −mysql> create table DemoTable1404    -> (    -> IpAddress varchar(40)    -> ); Query OK, 0 rows affected (1.02 sec)Insert some records in the table using insert −mysql> insert into DemoTable1404 values('192.168.120.0'); Query OK, 1 row affected (0.43 ... Read More

Update table and order dates in MySQL

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 10:52:35

410 Views

You cannot use UPDATE command with ORDER BY clause, but you can use SELECT statement with ORDER BY DESC.Let us first create a −mysql> create table DemoTable1403    -> (    -> DueDate timestamp    -> ); Query OK, 0 rows affected (1.26 sec)Insert some records in the table using ... Read More

Display substring in MySQL if the string is less than a specific length or display a custom message if it is more?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 10:50:57

173 Views

For this, you can use substring() function in MySQL. For conditions, use MySQL CASE statement. Let us first create a −mysql> create table DemoTable1402    -> (    -> EmployeeName varchar(40)    -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert −mysql> insert ... Read More

Advertisements