Samual Sam has Published 2492 Articles

Ordering alphabetically in MySQL except for one entry?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

113 Views

You can use ORDER BY clause for this. Let us first create a table −mysql> create table DemoTable (    FirstName varchar(200) ); Query OK, 0 rows affected (0.93 sec)Insert records in the table using insert command −mysql> insert into DemoTable values('Larry'); Query OK, 1 row affected (0.17 sec) mysql> ... Read More

DoubleBuffer duplicate() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

74 Views

A duplicate buffer of a buffer can be created using the method duplicate() in the class java.nio.DoubleBuffer. This duplicate buffer is identical to the original buffer. The method duplicate() returns the duplicate buffer that was created.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public ... Read More

LocalDateTime now() Method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

2K+ Views

The current date-time can be obtained from the system clock in the default time zone using the now() method in the LocalDateTime class in Java. This method requires no parameters and it returns the current date-time from the system clock in the default time zoneA program that demonstrates this is ... Read More

How to select data from a table where the table name has blank spaces in MYSQL?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

776 Views

You need to use backticks around the table name where the table name has blank space. Let us first create a table. Here, we have used backtick −mysql> create table `Demo Table138` (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Price int ); Query OK, 0 rows affected (0.47 ... Read More

DoubleBuffer compact() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

74 Views

The buffer can be compacted using the compact() method in the class java.nio.DoubleBuffer. This method does not require a parameter and it returns the new compacted DoubleBuffer with the same content as the original buffer. If the buffer is read-only, then the ReadOnlyBufferException is thrown.A program that demonstrates this is ... Read More

LocalDateTime parse() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

160 Views

The LocalDateTime instance can be obtained from a string value using the parse() method in the LocalDateTime class in Java. This method requires a single parameter i.e. the string which is to be parsed. This string cannot be null. Also, it returns the LocalDateTime instance obtained from the string value ... Read More

How to align a column right-adjusted in MySQL?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

2K+ Views

You can use LPAD() from MySQL for this. Let us first create a table −mysql> create table DemoTable (    FullName varchar(100) ); Query OK, 0 rows affected (0.81 sec)Insert records in the table using insert command −mysql> insert into DemoTable values('John Smith'); Query OK, 1 row affected (0.22 sec) ... Read More

LocalDateTime plus() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

154 Views

An immutable copy of a LocalDateTime where the required duration is added to it can be obtained using the plus() method in the LocalDateTime class in Java. This method requires two parameters i.e. the duration to be added and the TemporalUnit of the duration. Also, it returns the LocalDateTime object ... Read More

Querying average row length in MySQL?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

970 Views

You can use INFORMATION_SCHEMA.TABLES and AVG_ROW_LENGTH to query average row length in MySQL −SELECT AVG_ROW_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ‘yourTableName’;Let us first create a table −mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentName varchar(100) ); Query OK, 0 rows affected (0.90 sec)Insert ... Read More

DoubleBuffer compareTo() method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

88 Views

A buffer can be compared with another buffer using the method compareTo() in the class java.nio.DoubleBuffer. 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

Advertisements