Difference Between Two Timestamps in Seconds in MySQL

Chandu yadav
Updated on 30-Jul-2019 22:30:23

2K+ Views

Let us now see the following methods to calculate the time difference between two timestamps in seconds. Method The following is the query to calculate the difference between two timestamps. mysql> SELECT TIMESTAMPDIFF(SECOND, '2018-10-17 11:51:55', '2018-10-17 11:51:58'); The following is the output in seconds. +---------------------------------------------------------------------+ | TIMESTAMPDIFF(SECOND, '2018-10-17 11:51:55', '2018-10-17 11:51:58') | +---------------------------------------------------------------------+ | ... Read More

How Garbage Collector Works in C#

varma
Updated on 30-Jul-2019 22:30:23

2K+ Views

The garbage collector (GC) manages the allocation and release of memory. The garbage collector serves as an automatic memory manager. You do not need to know how to allocate and release memory or manage the lifetime of the objects that use that memory. An allocation is made any time you declare an object with a “new” keyword or a value type is boxed. Allocations are typically very fast. When there is not enough memory to allocate an object, the GC must collect and dispose of garbage memory to make memory available for new allocations. This process is known as ... Read More

Display MySQL Results as Comma-Separated List

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

2K+ Views

We can show the result as a comma separated list with the help of the ‘concat()’ function with the parameter ‘, ’. Let us see an example now. Firstly, we will create a table. The CREATE command is used to create a table. mysql> create table CommaSeperateDemo - > ( - > Id int, - > FirstName varchar(100), - > LastName varchar(100) - > ); Query OK, 0 rows affected (0.93 sec) Inserting records mysql> insert into CommaSeperateDemo values(1, 'John', 'Taylor'); Query ... Read More

Instruction Type MVI R, D8 in 8085 Microprocessor

Samual Sam
Updated on 30-Jul-2019 22:30:23

14K+ Views

MVI is a mnemonic, which actually means “Move Immediate”. With this instruction, we can load a register with an 8-bitsor 1-Bytevalue. This instruction supports immediate addressing mode for specifying the data in the instruction. In the instruction “d8” stands for any 8-bit data, and ‘r’ stands for any one of the registers e.g. A, B, C, D, E, H or L. So this r can replace any one of the seven registers. As ‘r’ can have any of the seven register names, so there are seven opcodes for this type of instruction. It occupies 2-Bytes in the memory. ... Read More

prev Function in PHP

Chandu yadav
Updated on 30-Jul-2019 22:30:23

116 Views

The prev() function rewinds the internal array pointer. It outputs the previous element in the array. Syntax prev(arr) Parameters arr − The specified array. Required. Return The pos() function returns the value of the previous element in an array. Example The following is an example − Live Demo Output one two one

MyISAM versus InnoDB in MySQL

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

317 Views

Both are engine types. Here is the query by which we can get to know which engine type and tables are being used. Firstly, we will choose the database with the help of USE command − mysql> USE business; Database changed Here is the query through which we can know which table or engine is being used − mysql> SHOW table status; The following is the output +------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ |Name | Engine | Version | Row_format | ... Read More

Change MySQL Column Definition

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

262 Views

To change MySQL column definition, we can use modify or change clause with ALTER command. Let us first create a table with a column as ID, with int data type. We will modify the same column name with varchar data type. Creating a table. mysql> create table ModifyColumnDemo -> ( -> id int -> ); Query OK, 0 rows affected (0.52 sec) Now, let us write the syntax to change the column definition. The syntax is as follows − alter table yourTableName modify column columnName data type; ... Read More

Rank Function in MySQL

Chandu yadav
Updated on 30-Jul-2019 22:30:23

808 Views

The rank() function can be used to give a rank for every row within the partition of a result set. First, let us create a table − mysql> create table RankDemo mysql> ( mysql> id int mysql> ); Query OK, 0 rows affected (0.53 sec) Inserting records into table. mysql> insert into RankDemo values(1); Query OK, 1 row affected (0.19 sec) mysql> insert into RankDemo values(3); Query OK, 1 row affected (0.12 sec) mysql> insert into RankDemo values(3); Query OK, 1 row affected (0.11 ... Read More

Long Term Evolution (LTE)

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

2K+ Views

Long – term evolution or LTE is a standard for wireless technology based upon GSM/EDGE and UMTS/HSPA technologies. It offers increased network capacity and speed to mobile device users. It is an extension of the 3G technology for high-speed mobile communications. LTE-Advanced is an improvement over LTE that meets the criteria of 4G wireless communications as laid down by IMT-Advanced standards. It provides greater speeds and better quality of communications. Both LTE and LTE-A are used for mobile broadband communications and in VoIP. Features of LTE LTE was specified by The 3rd Generation Partnership Project (3GPP) release 8 was ... Read More

Batch Insert in MySQL

Chandu yadav
Updated on 30-Jul-2019 22:30:23

3K+ Views

To do a batch insert, we need to use all column names with parenthesis, separated by ‘, ’. Let us see an example. First, we will create a table. The following is the CREATE command to create a table. mysql> CREATE table MultipleRecordWithValues - > ( - > id int, - > name varchar(100) - > ); Query OK, 0 rows affected (0.88 sec) The following is the syntax of batch insert. INSERT into yourTableName values(column1, column2, ....N), (column1, column2, ....N), (column1, column2, ....N), ...........N; ... Read More

Advertisements