AmitDiwan has Published 10740 Articles

How do I return multiple results in a MySQL subquery with IN()?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:59:21

379 Views

In MySQL, you can easily return multiple results, but also achieve this with subquery using IN(). Let us first create a table −mysql> create table DemoTable1317 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.49 sec)Insert some records ... Read More

Char.TryParse() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:59:21

481 Views

The Char.TryParse() method in C# is used to convert the value of the specified string to its equivalent Unicode character.Syntaxpublic static bool TryParse (string str, out char res);Let us now see an example to implement the Char.TryParse () method −Exampleusing System; public class Demo {    public static void Main(){ ... Read More

Char.ToUpperInvariant(Char) Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:57:49

233 Views

The Char.ToUpperInvariant() method in C# is used to convert the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture.Syntaxpublic static char ToUpperInvariant (char ch);Above, the parameter ch is the Unicode character to convert.Let us now see an example to implement the Char.ToUpperInvariant() ... Read More

Select words from a text already in a MySQL table

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:56:56

311 Views

Let us first create a table −mysql> create table DemoTable1316 -> ( -> Value varchar(40) -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1316 values('MySQL'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable1316 values('Java'); Query ... Read More

Math.Log10() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:55:43

404 Views

The Math.Log10() method in C# is returned to the base 10 logarithms of a specified number.Syntaxpublic static double Log10 (double val);Here, Val is the number whose logarithm we want.The Log10() method returns −Val parameterReturnsPositiveThe base 10 log of d; that is, log 10d.ZeroNegativeInfinityNegativeNaNEqual to NaNNaNEqual to PositiveInfinityPositiveInfinityLet us now see ... Read More

MySQL query to convert empty values to NULL?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:55:35

1K+ Views

It’s easy to convert empty values to NULL using SET and WHERE. Let us first create a table −mysql> create table DemoTable1315 -> ( -> CountryName varchar(10) -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command. We have set some empty values ... Read More

Math.Log() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:52:30

1K+ Views

The Math.Log() method in C# is used to return the logarithm of a specified number.Syntaxpublic static double Log(double num) public static double Log(double num, double base)Above, num is the specified number whose logarithm is to be calculated. Here, the base is the base of the logarithm.Let us now see an ... Read More

MySQL query to display records ordered by numeric difference?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:46:31

99 Views

Use ORDER BY and set the difference to display records ordered by numeric difference. Following is the syntax −select *from yourTableName order by (yourIntegerColumnName1 - yourIntegerColumnName2);Let us first create a table −mysql> create table DemoTable1313 -> ( -> Name varchar(20), -> Score1 int, -> Score2 int -> ); Query OK, ... Read More

How to use a comma-separated string in an `IN ()` in MySQL?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:46:30

2K+ Views

Set the comma-separated string in the IN() as in the below syntax:select *from yourTableName where yourColumnName IN('yourCommaSeparatedValue');Let us first create a table −mysql> create table DemoTable1314 -> ( -> Number varchar(100) -> ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert ... Read More

A single query to get the sum of count from different tables in MySQL?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 10:42:49

3K+ Views

To get the sum of count from different tables, use UNION ALL. Let us first create a table −mysql> create table DemoTable1 -> ( -> Id int, -> Name varchar(30) -> ); Query OK, 0 rows affected (1.55 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

Advertisements