AmitDiwan has Published 10744 Articles

Count NOT NULL values from separate tables in a single MySQL query

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:58:11

212 Views

To count values from separate tables, the syntax is as follows −Select    (    select count(yourColumnName) from yourTableName1) as anyAliasName1,    (    select count(yourColumnName) from yourTableName2) as anyAliasName2;Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int    -> ); Query ... Read More

OrderedDictionary Class in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:56:50

891 Views

The OrderedDictionary class represents a collection of key/value pairs that are accessible by the key or index.Following are the properties of OrderedDictionary class −Sr.noProperty & Description1CountGets the number of key/values pairs contained in the OrderedDictionary collection.2IsReadOnlyGets a value indicating whether the OrderedDictionary collection is read-only.3Item[Int32]Gets or sets the value at ... Read More

Reorder keys after deleting a record from MySQL table?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:53:47

533 Views

For this, use UPDATE command with some mathematical calculations. To delete an id, use the DELETE. Let us first create a table −mysql> create table DemoTable1476    -> (    -> Id int    -> ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert ... Read More

How to find the MaxCapacity of a StringBuilder in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:52:41

241 Views

To find the MaxCapacity of a StringBuilder, the code is as follows −Example Live Demousing System; using System.Text; public class Demo {    public static void Main(String[] args) {       StringBuilder strBuilder1 = new StringBuilder("Amy");       StringBuilder strBuilder2 = new StringBuilder("Katie");       StringBuilder strBuilder3 ... Read More

A single MySQL select query on two tables is possible?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:49:57

273 Views

Yes, it is possible. Following is the syntax −select * from yourTableName1, yourTableName2;Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using ... Read More

How to find the length of the StringBuilder in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:47:55

243 Views

To find the length of the StringBuilder in C#, the code is as follows −Example Live Demousing System; using System.Text; public class Demo {    public static void Main(String[] args) {       StringBuilder strBuilder1 = new StringBuilder("Amy");       StringBuilder strBuilder2 = new StringBuilder("Katie");       StringBuilder ... Read More

Fetch a value between different values in MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:45:53

163 Views

Use MySQL BETWEEN to fetch a value between different values. Let us first create a table −mysql> create table DemoTable1473    -> (    -> EmployeeCode varchar(20)    -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1473 values('EMP_120'); ... Read More

How to create a StringDictionary in C#?

AmitDiwan

AmitDiwan

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

94 Views

To create a StringDictionary in C#, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringDictionary strDict = new StringDictionary();       strDict.Add("A", "John");       strDict.Add("B", "Andy");       strDict.Add("C", ... Read More

How to convert char field to datetime field in MySQL?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:42:39

370 Views

Let us first create a table. Here, we have declared dates in char type −mysql> create table DemoTable1472    -> (    -> ShippingDate char(35)    -> ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1472 values('12/31/2017 10:50'); Query ... Read More

How to create a shallow copy of Hashtable in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:41:43

271 Views

To create a shallow copy of Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       Hashtable hash = new Hashtable();       hash.Add("1", "AB");       hash.Add("2", "BC");       hash.Add("3", "DE"); ... Read More

Advertisements