AmitDiwan has Published 10744 Articles

Select a column if condition is met in MySQL to fetch records from current date and current date + 1

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:04:51

507 Views

Let us first get the current date −mysql> select curdate();This will produce the following output −+------------+ | curdate()  | +------------+ | 2019-12-15 | +------------+ 1 row in set (0.00 sec)Let us first create a table −mysql> create table DemoTable1956    (    ProductId int,    ProductName varchar(20),    CustomerName varchar(20), ... Read More

jQuery eq() method

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:03:52

251 Views

The eq() method in jQuery is used to select an element with a specific index number. The index number begins at 0.SyntaxThe syntax is as follows −$(":eq(index)")Above, the parameter index is the index of the element.ExampleLet us now see an example to implement the jQuery eq() method − Live Demo ... Read More

MySQL - How can I fix an auto increment field with deleted rows from 1,2,3,4,5 to 1,3,5). Now we want it to be 1,2,3

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 07:01:43

615 Views

Let us first create a table −mysql> create table DemoTable1955    (    UserId int NOT NULL AUTO_INCREMENT    ,    PRIMARY KEY(UserId)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1955 values(); Query OK, 1 row affected ... Read More

Get day name for the corresponding date in MySQL?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:59:51

127 Views

To fetch day name, use DAYNAME() function in MySQL. Let us first create a table −mysql> create table DemoTable1954    (    ShippingDate date    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1954 values('2019-12-15'); Query OK, 1 row ... Read More

Display custom text in a new column on the basis of null values in MySQL?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:57:30

583 Views

Let us first create a table −mysql> create table DemoTable1953    (    StudentName varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1953 values('Chris'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1953 values(NULL); Query ... Read More

jQuery element Selector

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:55:41

191 Views

The element selector in jQuery is used to select all elements with the specific element name.SyntaxThe syntax is as follows −$("ele")Above, ele is the element to select.ExampleLet us now see an example to implement the jQuery element selector − Live Demo    $(document).ready(function(){       $("button").click(function(){   ... Read More

Set custom messages on the basis of a column with student marks in MySQL

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:53:59

144 Views

For this, use CASE statement. Let us first create a table −mysql> create table DemoTable1952    (    Marks int    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1952 values(35); Query OK, 1 row affected (0.00 sec) mysql> ... Read More

jQuery parent descendant Selector

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:52:50

208 Views

The parent descendant selector in jQuery is used to select all elements that are descendants of a specified element.SyntaxThe syntax is as follows −("parent descendant")ExampleLet us now see an example to implement the jQuery parent descendent selector − Live Demo    $(document).ready(function(){       $("div span").css("color", "red"); ... Read More

Split float value in two columns of a MySQL table?

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:50:55

758 Views

To split float value in two columns, the first column will have a value before decimal. The second column will have a value after decimal. For this, you can use SUBSTRING_INDEX() along with CAST(). Let us first create a table −mysql> create table DemoTable1951    (    Value1 varchar(20)   ... Read More

jQuery queue() with Examples

AmitDiwan

AmitDiwan

Updated on 31-Dec-2019 06:49:55

215 Views

The queue() method in jQuery is used to display the queue of functions to be executed on the selected elements.SyntaxThe syntax is as follows −$(selector).queue(queue)Above, the parameter queue is the name of the queue.ExampleLet us now see an example to implement the jQuery queue() method − Live Demo ... Read More

Advertisements