AmitDiwan has Published 11365 Articles

SELECT * WHERE var == [one of many alternatives] in MySQL?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:15:50

174 Views

Use IN() for select * where var== [one of many alternatives]. Let us first create a table −mysql> create table DemoTable1624     -> (     -> ClientId int,     -> ClientName varchar(20)     -> ); Query OK, 0 rows affected (0.39 sec)Insert some records in the ... Read More

How to sort an alphanumeric column with different lengths in MySQL?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:14:54

117 Views

Let us first create a table −mysql> create table DemoTable1623     -> (     -> StudentCode varchar(20)     -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1623 values('STU-MIT-143'); Query OK, 1 row affected (0.19 sec) ... Read More

Int16.Equals Method in C# with Examples

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:13:54

87 Views

The Int16.Equals() method in C# is used to return a value indicating whether this instance is equal to a specified object or Int16.SyntaxFollowing is the syntax −public bool Equals (short ob); public override bool Equals (object ob);Above, the parameter ob for the 1st syntax is an Int16 value to compare ... Read More

Array.FindAll() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:11:00

2K+ Views

The Array.FindAll() method in C# is used to retrieve all the elements that match the conditions defined by the specified predicate.SyntaxFollowing is the syntax −public static T[] FindAll (T[] array, Predicate match);ExampleLet us now see an example to implement the Array.FindAll() method −using System; public class Demo{    public static ... Read More

How to search for the exact string value in MySQL?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:10:21

126 Views

To search for the exact string value, use the concept of COLLATE. Let us first create a table −mysql> create table DemoTable1620     -> (     -> Subject varchar(20)     -> ); Query OK, 0 rows affected (0.42 sec)Insert some records in the table using insert command ... Read More

Array.Find() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:09:43

8K+ Views

The Array.Find() method in C# is used to search for an element that matches the conditions defined by the specified predicate and returns the first occurrence within the entire Array.SyntaxFollowing is the syntax −public static T Find (T[] array, Predicate match);Above, the array is the one-dimensional, zero-based array to search, ... Read More

Convert datetime to get month name in MySQL?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:09:24

275 Views

To get only month name, the syntax is as follows −select date_format(yourColumnName, '%M %Y') from yourTableName;Let us first create a table −mysql> create table DemoTable1619     -> (     -> ArrivalTime datetime     -> ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table ... Read More

How can I enhance my select query to make it faster in MySQL?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:08:21

98 Views

For quicker querying, use MySQL IN() because it uses indexing internally. Let us first create a table −mysql> create table DemoTable1618     -> (     -> ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,     -> ClientName varchar(20),     -> ClientEmailId varchar(30)     -> ); Query ... Read More

DateTime.ToShortDateString() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:08:13

6K+ Views

The DateTime.ToShortDateString() method in C# is used to convert the value of the current DateTime object to its equivalent short date string representation.SyntaxFollowing is the syntax −public string ToShortDateString ();ExampleLet us now see an example to implement the DateTime.ToShortDateString() method −using System; public class Demo {    public static void ... Read More

DateTime.ToOADate() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:07:08

502 Views

The DateTime.ToOADate() method in C# is used to convert the value of this instance to the equivalent OLE Automation date.SyntaxFollowing is the syntax −public double ToOADate ();ExampleLet us now see an example to implement the DateTime.ToOADate() method −using System; public class Demo {    public static void Main() {   ... Read More

Advertisements