AmitDiwan has Published 10740 Articles

Select multiple Book Titles that share the minimum (PRICE) value in MySQL?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 05:17:49

296 Views

For this, use MySQL MIN(). Let us first create a −mysql> create table DemoTable1414    -> (    -> BookTitle varchar(40),    -> BookPrice int    -> ); Query OK, 0 rows affected (0.82 sec)Insert some records in the table using insert −mysql> insert into DemoTable1414 values('Deep dive using java', ... Read More

Fastest way to search for a date from the date records in MySQL

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 05:15:05

301 Views

The fastest and easiest way is to use the MySQL BETWEEN keyword. Let us first create a −mysql> create table DemoTable1413    -> (    -> EmployeeName varchar(20),    -> EmployeeJoiningDate datetime    -> ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert −mysql> ... Read More

MySQL query to check if a certain row has only two words?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 05:13:35

408 Views

For this, use Regular Expression in MySQL as in the below syntax −select * from yourTableName where yourColumnName regexp '^[^ ]+[ ]+[^ ]+$';The above query will work when the two words are separated by a space. Let us first create a −mysql> create table DemoTable1412    -> (    -> ... Read More

MySQL query to find a value in a set of values separated by comma in a custom variable

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 05:12:02

248 Views

For this, use FIND_IN_SET() in MySQL and use the value from a custom variable. Let us first create a −mysql> create table DemoTable1411    -> (    -> Value int    -> )    -> ; Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert ... Read More

How to mask data fields in MySQL?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 05:08:56

1K+ Views

To mask data fields, use CONCAT() along with REPEAT(). Here, we will mask data fields with #. Let us first create a −mysql> create table DemoTable1410    -> (    -> Password varchar(80)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert ... Read More

jQuery event.delegateTarget Property

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 13:04:43

142 Views

The event.delegateTarget property in jQuery is used to return the element where the currently-called jQuery event handler was attached.SyntaxThe syntax is as follows −event.delegateTargetExampleLet us now see an example to implement the jQuery event.delegateTarget property −    $(document).ready(function(){       $("div").on("click", "button", function(event){     ... Read More

jQuery nextAll() method

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 12:54:02

179 Views

The nextAll() method in jQuery is used to return all next sibling elements of the selected element.ExampleLet us now see an example to implement the jQuery nextAll() method −    .demo * {       display: block;       border: 3px solid yellow;     ... Read More

jQuery next() method

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 12:50:49

256 Views

The next() selector in jQuery is used to return the next sibling element of the selected element.SyntaxThe syntax is as follows −$(selector).next(filter)Above, the parameter filter is a selector expression to narrow down the next sibling searchExampleLet us now see an example to implement the jQuery next() selector − ... Read More

jQuery contents()

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 12:47:11

206 Views

The contents() method in jQuery is used to return all direct children, including text and comment nodes, of the selected element.SyntaxThe syntax is as follows −$(selector).contents()ExampleLet us now see an example to implement the jQuery contents() method −    $(document).ready(function(){       $("button").click(function(){ ... Read More

jQuery children() method

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 12:44:49

238 Views

The children() method in jQuery is used to return all direct children of the selected element.ExampleLet us now see an example to implement the jQuery children() method −    .demo * {       display: block;       border: 2px solid blue;       ... Read More

Advertisements