You can group month and year with the help of function DATE_FORMAT() in MySQL. The GROUP BY clause is also used.The syntax is as follows −SELECT DATE_FORMAT(yourColumnName, '%m-%Y') from yourTableName GROUP BY MONTH(yourColumnName), YEAR(yourColumnName)DESC;To understand the above concept, let us create a table. The following is the query to create a table −mysql> create table GroupMonthAndYearDemo −> ( −> DueDate datetime −> ); Query OK, 0 rows affected (1.49 sec)Insert records in the table using the following query −mysql> insert into GroupMonthAndYearDemo values(now()); Query OK, 1 row affected (0.11 sec) ... Read More
According to the microprocessor point of view, the 8253 is designed and has some specialty port chip I/O. We don't use it for interfering the I/O devices. For performing the application of time it is used. 8253 has the addressed A1 and A0 input pins.The counters have width of 16 bits. If they were 8-bits wide, the delay in time that would be generated is very small. The Least Significant Byte and the Most Significant Byte of a counter is selected by using the same address of the port.The processor here writes to the control port to configure the working of ... Read More
PhonePe is a very popular and useful application especially in today’s era of digitization. The app is named after Fin-Tech company, the headquarters of which are in Bangalore, India. It is quite recent, as it was found in December 2015.Uses of PhonePe1. Mobile recharge: By using this app, you can get your mobile phone recharged very easily. You simply need to mention the amount, phone number and the appropriate mobile operator's name. You can even browse plans. You don’t have to load funds into your wallet for the recharge. Rather, you can make payments from your bank account by using ... Read More
The ftp_set_option() function sets runtime options for the FTP connection.Syntaxftp_set_option(conn,option,value);Parametersconn − The FTP connectionoption − The runtime option to set. The following are the possible values:- FTP_TIMEOUT_SEC- FTP_AUTOSEEKvalue − The value of the option parameter set aboveReturnThe ftp_set_option() function returns TRUE if the option could be set, or FALSE.ExampleThe following is an example −
Let us see how we can create BigDecimal values via a long. Here, we have set long values as a parameter to the BigDecimal constructor.BigDecimal val1 = BigDecimal.valueOf(289L); BigDecimal val2 = BigDecimal.valueOf(299L);We can also perform mathematical operations on it −val2 = val2.subtract(val1);The following is an example −Example Live Demoimport java.math.BigDecimal; public class Demo { public static void main(String[] argv) throws Exception { BigDecimal val1 = BigDecimal.valueOf(289L); BigDecimal val2 = BigDecimal.valueOf(299L); System.out.println("Value 1 : "+val1); ... Read More
To delete under safe mode, you can use the below query −SET SQL_SAFE_UPDATES = 0;To understand the above query, let us create a table. The following is the query to create a table −mysql> create table SafeDeleteDemo −> ( −> Price int −> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table with the help of insert command. The query is as follows −mysql> insert into SafeDeleteDemo values(100); Query OK, 1 row affected (0.11 sec) mysql> insert into SafeDeleteDemo values(200); Query OK, 1 row affected (0.19 sec) mysql> insert into SafeDeleteDemo ... Read More
Vinton G. Cerf is known as the “Father of the Internet". He is the co-designer of the TCP/IP protocols and the architecture of the Internet. The US President, Bill Clinton presented the U.S. National Medal of Technology to Cerf and his colleague, Robert E. Kahn, for founding and developing the wonderful creation of the Internet in December 1997.The contribution of Cerf and his colleagues have been acknowledged and applauded all over the world. Today, we cannot imagine our lives without the Internet.Vint Cerf has been awarded many honorary degrees and prizes that include the Turing Award, the Presidential Medal of ... Read More
To select the top 2 rows from each group, use the where condition with subquery. Let us create a table. The query to create a table is as follows:mysql> create table selectTop2FromEachGroup -> ( -> Name varchar(20), -> TotalScores int -> ); Query OK, 0 rows affected (0.80 sec)Now insert some records in the table using insert command. The query is as follows:mysql> insert into selectTop2FromEachGroup values('John', 32); Query OK, 1 row affected (0.38 sec) mysql> insert into selectTop2FromEachGroup values('John', 33); Query OK, 1 row affected (0.21 sec) mysql> insert into selectTop2FromEachGroup values('John', 34); Query OK, ... Read More
Let us see how we can create BigDecimal values via string. Here, we have set string as a parameter to the BigDecimal constructor.BigDecimal val1 = new BigDecimal("375789755.345778656"); BigDecimal val2 = new BigDecimal("525678755.155778656");We can also perform mathematical operations on it −val2 = val2.subtract(val1);The following is an example −Example Live Demoimport java.math.BigDecimal; public class Demo { public static void main(String[] argv) throws Exception { BigDecimal val1 = new BigDecimal("375789755.345778656"); BigDecimal val2 = new BigDecimal("525678755.155778656"); System.out.println("Value 1 : "+val1); System.out.println("Value 2 : "+val2); val2 = val2.subtract(val1); System.out.println("Result (Subtraction) = "+val2); } }OutputValue 1 : 375789755.345778656 Value 2 : 525678755.155778656 Result (Subtraction) = 149888999.810000000
To extract year from date format, you can use in-built function YEAR() from MySQL. The query is as follows −mysql> SELECT YEAR(curdate()) as OnlyYearFromCurrentDate;The following is the output −+-------------------------+ | OnlyYearFromCurrentDate | +-------------------------+ | 2018 | +-------------------------+ 1 row in set (0.00 sec)Or you can do in the following way −mysql> SELECT YEAR(date(now())) as OnlyYearFromCurrentDate;The following is the output −+-------------------------+ | OnlyYearFromCurrentDate | +-------------------------+ | 2018 ... Read More