AmitDiwan has Published 10740 Articles

Perform MySQL SELECT on fields containing null values?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:18:58

107 Views

To check for NULL values in SELECT, use MySQL NULL. Let us first create a table −mysql> create table DemoTable1455    -> (    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1455 values('John'); ... Read More

Get or set the number of elements in the BitArray in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:17:55

143 Views

To get or set the number of elements in the BitArray, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       BitArray arr1 = new BitArray(2);       BitArray arr2 = new BitArray(2);       ... Read More

MySQL query to get next closest day between two days?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:15:51

202 Views

Following is the syntax −select * from yourTableName order by ( yourColumnName> now()) desc, (case when yourColumnName > now() then yourColumnName end) ,    yourColumnName  desc limit 1;Let us first create a table −mysql> create table DemoTable1454    -> (    -> ShippingDate date    -> ); Query OK, 0 ... Read More

Union of SortedSet to a collection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:13:06

162 Views

To compute the Union of SortedSet to a Collection, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       SortedSet set1 = new SortedSet();       set1.Add(50);       set1.Add(100);       set1.Add(150);   ... Read More

Print structured MySQL SELECT at command prompt

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:09:40

242 Views

To print, the syntax is as follows −mysql -uroot -t -e "your Select Query  " -pTo implement the above syntax, let us open the command prompt −Now, reach the MySQL bin −Let us implement the above syntax to easily print structured SQL select. Following is the query −This will produce ... Read More

Bitwise OR operation between the elements of BitArray in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:07:37

108 Views

Let us see how to implement Bitwise OR operation between the elements of BitArray −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       BitArray arr1 = new BitArray(5);       BitArray arr2 = new BitArray(5);       arr1[0] = ... Read More

Count duplicate ids and display the result in a separate column with MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:06:06

222 Views

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

Get or set the element at the specified index in ArrayList in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:04:38

1K+ Views

To get or set the element at the specified index in ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       ArrayList arrList = new ArrayList();       arrList.Add("Laptop");       arrList.Add("Desktop");     ... Read More

Count multiple rows and display the result in different columns (and a single row) with MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:02:38

743 Views

Let us first create a table −mysql> create table DemoTable1452    -> (    -> FavouriteColor varchar(50)    -> ); Query OK, 0 rows affected (2.42 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1452 values('Red'); Query OK, 1 row affected (0.31 sec) mysql> insert into ... Read More

Get or set the element at specified index in Collection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:01:43

297 Views

To get or set the element at specified index in Collection, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo {    public static void Main() {       Collection col = new Collection();       col.Add("Laptop");       col.Add("Desktop");       ... Read More

Advertisements