AmitDiwan has Published 10744 Articles

Convert datetime to get month name in MySQL?

AmitDiwan

AmitDiwan

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

359 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

156 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

7K+ 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

751 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

Create a Stored Procedure with MySQL and set a limit to display only a specific number of records

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:06:45

724 Views

Let us first create a table −mysql> create table DemoTable1368     -> (     -> ClientId int,     -> ClientName varchar(20)     -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1368 values(101, 'Adam'); Query ... Read More

How do I SELECT none of the rows and columns in MySQL?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:05:25

780 Views

To display none of the rows and columns, use SELECT NULL and FALSE as in the below syntax −select null from yourTableName where false;Let us first create a table −mysql> create table DemoTable1367     -> (     -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,     -> ... Read More

Char.CompareTo() Method in C#

AmitDiwan

AmitDiwan

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

4K+ Views

The Char.CompareTo() method in C# is used to compare this instance to a specified object or value type, and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified object or value type.SyntaxFollowing is the syntax −public int CompareTo (char val); ... Read More

Byte.ToString() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 11:03:29

72 Views

The Byte.ToString() method in C# converts the value of the current Byte object to its equivalent string representation.SyntaxFollowing is the syntax −public override string ToString ();ExampleLet us now see an example to implement the Byte.ToString() method −using System; public class Demo {    public static void Main(){       ... Read More

Byte.MinValue Field in C#

AmitDiwan

AmitDiwan

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

93 Views

The Byte.MinValue field in C# is used to represent the smallest possible value of a Byte.SyntaxFollowing is the syntax −public const byte MinValue = 0;ExampleLet us now see an example to implement the Byte.MinValue method −using System; public class Demo {    public static void Main(){       byte ... Read More

Select * but ignore displaying results containing a specific character in MySQL

AmitDiwan

AmitDiwan

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

387 Views

To ignore a specific character, use NOT LIKE operator. Let us first create a table −mysql>  create table DemoTable1366     -> (     -> CountryName varchar(20)     -> ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

Advertisements