AmitDiwan has Published 10744 Articles

Insert data from one table to another in MySQL?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:44:49

990 Views

To insert data from one table to another, use the INSERT INTO SELECT statement. Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int,    -> FirstName varchar(20)    -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table ... Read More

Select date from MySQL and format to text?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:42:55

204 Views

To select date and format, use SELECT DATE_FORMAT(). Following is the syntax −Syntaxselect date_format(yourColumnName, '%e %b %y') from yourTableName;Let us first create a table −mysql> create table DemoTable    -> (    -> DueDate date    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table ... Read More

Group MySQL rows in an array by column value?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:40:22

3K+ Views

To group rows in an array, use GROUP_CONCAT() along with the ORDER BY clause. Let us first create a table −mysql> create table DemoTable    -> (    -> Id int,    -> FirstName varchar(20)    -> ); Query OK, 0 rows affected (0.78 sec)Insert some records in the table ... Read More

Get the HashCode for the current UInt32 instance in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:32:46

128 Views

To get the HashCode for the current UInt32 instance, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       uint val1 = 100;       uint val2 = UInt16.MinValue;       Console.WriteLine("HashCode for val1 = "+val1.GetHashCode());   ... Read More

Using foreach loop in arrays in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:30:45

247 Views

Let us see an example to use foreach loop in arrays −Example Live Demousing System; public class Demo {    public static void Main() {       string[] products = new string[] { "Electronics", "Accessories", "Clothing", "Toys", "Clothing", "Furniture" };       Console.WriteLine("Products list...");       foreach(string s ... Read More

Get the angle whose sine is float value argument in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:26:30

151 Views

To get the angle whose sine is float value argument, the code is as follows −Exampleusing System; public class Demo {    public static void Main() {       float val1 = 0.1f;       float val2 = 8.9f;       Console.WriteLine("Angle (val1) = "+(MathF.Asin(val1)));     ... Read More

Get the hyperbolic arc-cosine of a floating-point value in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:10:22

130 Views

To get the hyperbolic arc-cosine of a floating-point value, the code is as follows −Exampleusing System; public class Demo {    public static void Main() {       float val1 = 0.1f;       float val2 = 0.9f;       Console.WriteLine("Angle (val1) = "+(MathF.Acosh(val1)));       ... Read More

Check whether the specified character has a surrogate code in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:07:06

221 Views

To check whether the specified character has a surrogate code, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       string str = new String(new char[] { 'k', 'm', 'g', 't', '\uD800' });       bool res = ... Read More

How to get Synchronize access to the StringDictionary in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 11:02:44

91 Views

To get synchronize access to the StringDictionary, 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", "Books");       strDict.Add("B", "Electronics");       ... Read More

How to get Synchronize access to the StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 10:57:21

76 Views

To get synchronize access to the StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection stringCol = new StringCollection();       String[] arr = new String[] { "100", "200", "300", "400", "500" }; ... Read More

Advertisements