Kumar Varma has Published 107 Articles

What is the best IDE of C++ on Window?

Kumar Varma

Kumar Varma

Updated on 10-Feb-2020 12:48:57

243 Views

Big projects are difficult to manage on mere text editors. You're likely to be more productive and less frustrated if you use an IDE in such cases. There are various types of IDE's and you should select the right one which fits your needs. There is no single best IDE ... Read More

What MySQL functions can we use to change the character case of a string?

Kumar Varma

Kumar Varma

Updated on 04-Feb-2020 06:02:25

181 Views

We can use LCASE() and LOWER() functions for changing the character case of a string to lower case and UCASE() and UPPER() functions for changing the character case of a string to upper case.Examplemysql> Select LCASE('NEW DELHI'); +--------------------+ | LCASE('NEW DELHI') | +--------------------+ | new delhi       ... Read More

When MySQL LOCATE() function returns NULL as the output?

Kumar Varma

Kumar Varma

Updated on 03-Feb-2020 06:11:55

320 Views

It will return NULL as the output when the value of either first argument i.e. substring or the value of second argument i.e. substring is NULL. Example below will demonstrate it −Examplemysql> Select LOCATE(NULL, 'Ram is a good boy')As Result; +--------+ | Result | +--------+ | NULL   | ... Read More

Is there any way to use values from a JSON object in a MySQL Select statement?

Kumar Varma

Kumar Varma

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

215 Views

Yes, you can use json_extract(). Let us first create a table −mysql> create table DemoTable    -> (    -> Data json    -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('{"Name": "John", "CountryName": "US"}'); Query OK, ... Read More

STR_TO_DATE as column, but column not found?

Kumar Varma

Kumar Varma

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

93 Views

You can use having clause. Let us first create a table −mysql> create table DemoTable    -> (    -> AdmissionDate varchar(100)    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('10/12/2017'); Query OK, 1 row affected ... Read More

MySQL query to select rows except first row in descending order?

Kumar Varma

Kumar Varma

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

894 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Amount int    -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.17 sec) mysql> insert ... Read More

How to get the data associated with the maximum id in a MySQL table?

Kumar Varma

Kumar Varma

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

115 Views

We will first order by DESC and then fetch the value associated with maximum id −select *from yourTableName order by yourColumnName DESC LIMIT 1, 1;Let us first create a table −mysql> create table DemoTable    -> (    -> Alldata int    -> ); Query OK, 0 rows affected (0.63 ... Read More

Update table with duplicate ids in MySQL

Kumar Varma

Kumar Varma

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

599 Views

Following is the syntax −update yourTableName set yourColumnName1= yourValue where yourColumnName2=yourValue order by yourColumnName2 DESC LIMIT 1;Let us first create a table −mysql> create table DemoTable    -> (    -> Id int,    -> Name varchar(100)    -> ); Query OK, 0 rows affected (0.61 sec)Insert some records in ... Read More

Multiply values of two columns and display it a new column in MySQL?

Kumar Varma

Kumar Varma

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

3K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> NumberOfItems int,    -> Amount int    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(4, 902); Query OK, 1 row affected ... Read More

Select last record and update it in MySQL?

Kumar Varma

Kumar Varma

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

3K+ Views

For this, you can use ORDER BY DESC LIMIT. Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Name varchar(100)    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table ... Read More

Previous 1 ... 4 5 6 7 8 ... 11 Next
Advertisements