Karthikeya Boyini has Published 2545 Articles

Can we use ORDER BY NULL in MySQL?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:02:38

304 Views

Yes, we can do thatNote − Before MySQL 5.7, ORDER BY NULL was useful, but with MySQL 8.0, specifying ORDER BY NULL, for example, at the end to suppress implicit sorting is no longer necessary.Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(10) -> ... Read More

Sort a column in descending order after placing argument in MySQL IN()?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:01:35

47 Views

For this, use FIELD() function with DESC. Let us first create a table −mysql> create table DemoTable -> ( -> Number int -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.16 ... Read More

How to use addAll() in android CopyOnWriteArraySet?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:59:14

51 Views

Before getting into example, we should know what CopyOnWriteArraySetis. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrate about How to use addAll() in android CopyOnWriteArraySetStep 1 − Create a new project in Android ... Read More

How to search an element in android ArrayBlockingQueue?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:58:17

67 Views

Before getting into example, we should know what arrayblockingqueue is, it travels FIFO manner and first element going to live longest period of time and last element of the queue going to live short period of the time.This example demonstrate about How to search an element in android ArrayBlockingQueueStep 1 ... Read More

How to get last element in android ConcurrentLinkedDeque?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:57:01

86 Views

Before getting into example, we should know what ConcurrentLinkedDequeis, it is unbounded deque based on linked nodes. Multiple threads can access deque elements with safety.This example demonstrate about How to get last element in android ConcurrentLinkedDequeStep 1 − Create a new project in Android Studio, go to File ⇒ New ... Read More

MySQL query to remove special characters from column values?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:56:49

1K+ Views

Let us first create a table −mysql> create table DemoTable -> ( -> StudentId varchar(100) -> ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('STU#123'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('STU#567'); ... Read More

MySQL query to get the next number in sequence for AUTO_INCREMENT field?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:55:48

836 Views

Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(); Query OK, 1 row affected (0.19 sec) ... Read More

Convert hex string to number in MySQL?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:51:10

1K+ Views

Use the CONV() method to convert hex string to number −select CONV(yourColumnName, 16, 10) AS anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> HexString varchar(100) -> ); Query OK, 0 rows affected (0.82 sec)Insert some records in the table using insert command −mysql> ... Read More

MySQL query to display a substring before a special character in a string

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:49:13

246 Views

Use the LOCATE() and SUBSTRING() method for this in MySQL. Let us first create a table −mysql> create table DemoTable    -> (    -> Title text    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Introduction ... Read More

Why BINARY keyword used with MySQL REGEXP operator?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 13:48:06

405 Views

Use the BINARY keyword to force REGEXP to match the string as a binary string. We will see the difference here.Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using ... Read More

Advertisements