Select Entries with Timestamp After X Time in MySQL

AmitDiwan
Updated on 05-Nov-2019 06:59:01

464 Views

Let us first create a table −mysql> create table DemoTable1335    -> (    -> ArrivalTime datetime    -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command. We have inserted date time records here −mysql> insert into DemoTable1335 values('2019-09-19 22:54:00'); Query OK, 1 row affected (0.46 sec) mysql> insert into DemoTable1335 values('2019-09-19 22:59:00'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1335 values('2019-09-19 22:56:00'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1335 values('2019-09-19 22:52:00'); Query OK, 1 row affected (0.11 sec)Display all records from the table using ... Read More

CharEnumerator Reset Method in C#

AmitDiwan
Updated on 05-Nov-2019 06:58:50

129 Views

The CharEnumerator.Reset() method in C# initializes the index to a position logically before the first character of the enumerated string.Syntaxpublic void Reset ();ExampleLet us now see an example to implement the CharEnumerator.Reset() method −using System; public class Demo {    public static void Main(){       string strNum = "This is it!";       CharEnumerator ch = strNum.GetEnumerator();       Console.WriteLine("HashCode = "+ch.GetHashCode());       Console.WriteLine("Get the Type = "+ch.GetType());       while (ch.MoveNext())          Console.Write(ch.Current + " ");       ch.Reset();       Console.WriteLine();       while (ch.MoveNext()) ... Read More

Insert Values in Two Tables with a Single Stored Procedure Call in MySQL

AmitDiwan
Updated on 05-Nov-2019 06:56:13

2K+ Views

Following is the syntax to insert values in two tables with a stored procedure −DELIMITER // CREATE PROCEDURE yourProcedureName(anyVariableName int)    BEGIN    insert into yourTableName1(yourColumnName1) values(yourVariableName);    insert into yourTableName2(yourColumnName2) values(yourVariableName);    END //Let us first create a table −mysql> create table DemoTable1    -> (    -> StudentScore int    -> ); Query OK, 0 rows affected (0.58 sec)Following is the second table −mysql> create table DemoTable2    -> (    -> PlayerScore int    -> ); Query OK, 0 rows affected (0.52 sec)Here is the query to create a stored procedure and insert values in two tables ... Read More

jQuery Checkbox Selector

AmitDiwan
Updated on 05-Nov-2019 06:56:05

470 Views

The jQuery :checkbox selector is used to select input elements with type checkbox.SyntaxThe syntax is as follows −$(":checkbox")ExampleLet us see an example to implement the :checkbox selector in jQuery −    $(document).ready(function(){       $(":checkbox").wrap("");    }); Fill the form ID: Rank: Fav. Subjects: Maths: English OutputThis will produce the following output −ExampleLet us see another example −    $(document).ready(function(){       $(":checkbox").wrap("");    }); Hobbies Player Name: Fav Sports Football: Cricket OutputThis will produce the following output −

jQuery Button Selector

AmitDiwan
Updated on 05-Nov-2019 06:54:51

518 Views

The jQuery :button selector is used to select button and input elements with type button.ExampleLet us now see an example to implement the :button selector −    $(document).ready(function(){       $(":button").css("border-width", "5px");    }); Username: Password: Demo Button OutputThis will produce the following output. The border of the “Demo Button” is changed using the :button selector −ExampleLet us now see another example −    .one {       color: white;       background-color: gray;       font-size: 16px;       border: 2px yellow dashed;    }    $(document).ready(function(){       $(":button").addClass( "one" );    }); ID: Rank: Demo Button OutputThis will produce the following output −

MySQL Row Declarations for Zend Framework

AmitDiwan
Updated on 05-Nov-2019 06:53:33

293 Views

The ZF stands for ZEROFILL i.e. row declarations for zero fill Let us first create a table. Here, we have set the int field size to be 10 −mysql> create table DemoTable1332    -> (    -> Number int(10) ZEROFILL NOT NULL DEFAULT 0    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1332 values(); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1332 values(1); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1332 values(10); Query OK, 1 row affected (0.10 sec) mysql> insert ... Read More

IEnumerator.MoveNext Method in C#

AmitDiwan
Updated on 05-Nov-2019 06:52:44

400 Views

The CharEnumerator.MoveNext() method in C# is used to increments the internal index of the current CharEnumerator object to the next character of the enumerated string.Syntaxpublic bool MoveNext ();Let us now see an example to implement the CharEnumerator.MoveNext() method −Exampleusing System; public class Demo {    public static void Main(){       string strNum = "john";       CharEnumerator ch = strNum.GetEnumerator();       Console.WriteLine("HashCode = "+ch.GetHashCode());       Console.WriteLine("Get the Type = "+ch.GetType());       while (ch.MoveNext())          Console.Write(ch.Current + " ");       // disposed       ch.Dispose();   ... Read More

Use the SIGN() Function in MySQL

AmitDiwan
Updated on 05-Nov-2019 06:51:43

479 Views

To use the @ sign, use MySQL SET command. The @sign is used to set user-defined variables. Following is the syntax −SET @anyVariableName:=yourValue;Let us first create a table −mysql> create table DemoTable1331    -> (    -> Id int,    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1331 values(10, 'Chris'); Query OK, 1 row affected (0.71 sec) mysql> insert into DemoTable1331 values(101, 'David'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1331 values(40, 'Bob'); Query OK, 1 row affected (0.12 sec) ... Read More

Format a Number as Decimal for MySQL

AmitDiwan
Updated on 05-Nov-2019 06:48:12

219 Views

You do not need to format a number in MySQL, for this use DECIMAL data type. Let us first create a table −mysql> create table DemoTable1330    -> (    -> Amount DECIMAL(10, 2)    -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1330 values(10944.7893); Query OK, 1 row affected, 1 warning (0.13 sec) mysql> insert into DemoTable1330 values(9848.44); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable1330 values(8009.90); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable1330 values(1000.99); Query OK, 1 row affected ... Read More

GetType Method in C# CharEnumerator

AmitDiwan
Updated on 05-Nov-2019 06:47:59

48 Views

The CharEnumerator.GetType() method in C# is used to get the type of the current instance.Syntaxpublic Type GetType();Let us now see an example to implement the CharEnumerator.GetType() method −Exampleusing System; public class Demo {    public static void Main(){       string strNum = "john";       CharEnumerator ch = strNum.GetEnumerator();       Console.WriteLine("HashCode = "+ch.GetHashCode());       Console.WriteLine("Get the Type = "+ch.GetType());       while (ch.MoveNext())          Console.Write(ch.Current + " ");       // disposed       ch.Dispose();       // this will show an error since we disposed ... Read More

Advertisements