- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
97 Views
A buffer can be compared with another buffer using the method compareTo() in the class java.nio.ByteBuffer. This method returns a negative integer if the buffer is less than the given buffer, zero if the buffer is equal to the given buffer and a positive integer if the buffer is greater ... Read More
karthikeya Boyini
155 Views
You can use the following syntax if your column has varchar data type −select yourColumnName FROM yourTableName ORDER BY yourColumnName +0 DESC;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table selectOrderdemo -> ( -> Id ... Read More
karthikeya Boyini
127 Views
To merge selects together, you need to use GROUP BY clause. To understand the concept, let us create a table. The query to create a table is as follows −mysql> create table MergingSelectDemo -> ( -> RoomServicesId int, -> RoomId int, -> ServiceId int -> ... Read More
karthikeya Boyini
65 Views
Use the contains() method to search a value in Triplet class.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following package −import org.javatuples.Triplet;Note − Steps to download and run JavaTuples program If you are using Eclipse ... Read More
karthikeya Boyini
223 Views
The string representation of an Instant can be obtained using the toString() method in the Instant class in Java. This method requires no parameters and it returns the string representation of the Instant.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { ... Read More
karthikeya Boyini
2K+ Views
To copy data from one field to another on every row, use the UPDATE command.Let us first create a table −mysql> create table DemoTable ( StudentId int, StudentFirstName varchar(20), StudentMarks int default 0 ); Query OK, 0 rows affected (0.49 sec)Following is the query to ... Read More
karthikeya Boyini
74 Views
The immutable copy of a duration with the required nanoseconds is obtained using the method withNanos() in the Duration class in Java. This method requires a single parameter i.e. the number of nanoseconds and it returns the duration with the required nanoseconds that were passed as a parameter.A program that ... Read More
karthikeya Boyini
219 Views
To work with time in PHP/ MySQL, you can use strtotime() function. The PHP code is as follows for the same −$timeValue='8:55 PM'; $changeTimeFormat = date('H:i:s', strtotime($timeValue)); echo("The change Format in 24 Hours="); echo($changeTimeFormat);The snapshot of PHP code is as follows −Here is the output.Here is the MySQL query to ... Read More
karthikeya Boyini
2K+ Views
You can use the concept of toArray() to create array. Following is the syntax −db.yourCollectonName.find({}, {yourFieldName:1}).toArray();Let us create a collection with documents −> db.createArrayDemo.insertOne({"UserName":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6461de8cc557214c0e00") } > db.createArrayDemo.insertOne({"UserName":"David"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6467de8cc557214c0e01") } > db.createArrayDemo.insertOne({"UserName":"Robert"}); { ... Read More
karthikeya Boyini
597 Views
There is no equivalent of ROW_NUMBER() in MySQL for inserting but you can achieve this with the help of variable. The syntax is as follows −SELECT (@yourVariableName:=@yourVariableName + 1) AS `anyAliasName`, yourColumnName1, yourColumnName2, ...N FROM yourTableName ,(SELECT @yourVariableName:=0) AS anyAliasName;To understand the above syntax, let us create a table. The ... Read More