AmitDiwan has Published 10740 Articles

CharEnumerator.GetType() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:47:59

48 Views

The CharEnumerator.GetType() method in C# is used to get the type of the current instance.Syntaxpublic Type GetType();Let us now see an example to implement the CharEnumerator.GetType() method −Exampleusing System; public class Demo {    public static void Main(){       string strNum = "john";       CharEnumerator ch ... Read More

How to TRIM x number of characters, beginning from the last in MySQL?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:45:55

322 Views

For this, you can use substring() along with length(). Let us first create a table −mysql> create table DemoTable1329    -> (    -> StudentName varchar(40)    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1329 values('David Miller'); ... Read More

Insert values in a table by MySQL SELECT from another table in MySQL?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:41:53

962 Views

Fir this, use INSERT INTO SELECT statement. Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int,    -> Name varchar(20),    -> Age int    -> ); Query OK, 0 rows affected (1.72 sec)Insert some records in the table using insert command ... Read More

MySQL query to extract time in a format without seconds

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:38:25

387 Views

For this, you can use time_format(). Let us first create a table −mysql> create table DemoTable1326    -> (    -> Arrivaltime time    -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1326 values('12:10:45'); Query OK, 1 row ... Read More

Order MySQL results without identifier?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:35:51

156 Views

To order MySQL results without identifier, the syntax is as follows −select * from yourTableName order by 1 DESC LIMIT yourLimitValue;Let us first create a table −mysql> create table DemoTable1325    -> (    -> Id int,    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.69 ... Read More

How to identify composite primary key in any MySQL database table?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:28:38

2K+ Views

You can use aggregate function count(*). If it returns a value greater than 1, that would mean the table has composite primary key.Let us first create a table −mysql> create table DemoTable1324    -> (    -> StudentId int,    -> StudentName varchar(20),    -> StudentAge int,    -> StudentCountryName ... Read More

MySQL query to get the last created table name (most recent)?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:26:19

292 Views

You can use the concept INFORMATION_SCHEMA.TABLES for this. Let us first create a table. This would be our most recent table −mysql> create table DemoTable1323    -> (    -> FirstName varchar(10)    -> ); Query OK, 0 rows affected (0.43 sec)Insert some records in the table using insert command ... Read More

Create a MySQL table from already created table selecting specific rows?

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 11:11:01

195 Views

To create a table from an already created table, use CREATE TABLE AS SELECT statement. Let us first create a table −mysql> create table DemoTable1318 -> ( -> Id int, -> FirstName varchar(10), -> LastName varchar(10), -> Age int -> ); Query OK, 0 rows affected (0.50 sec)Insert some records ... Read More

CharEnumerator.GetHashCode() Method in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 11:08:18

97 Views

The CharEnumerator.GetHashCode() method in C# returns a hash code for the current object.Syntaxpublic virtual int GetHashCode ();Let us now see an example to implement the CharEnumerator.GetHashCode() method −Exampleusing System; public class Demo {    public static void Main(){       string strNum = "john";       CharEnumerator ch ... Read More

Dictionary.Count Property in C#

AmitDiwan

AmitDiwan

Updated on 04-Nov-2019 11:05:31

513 Views

The Dictionary. Count property in C# gets the number of key/value pairs in the Dictionary.syntaxpublic int Count { get; }Let us now see an example to implement the Dictionary. Count property −Exampleusing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Dictionary dict = ... Read More

Advertisements