AmitDiwan has Published 10744 Articles

MySQL row declarations for ZF?

AmitDiwan

AmitDiwan

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

278 Views

The ZF stands for ZEROFILL i.e. row declarations for zero fill Let us first create a table. Here, we have set the int field size to be 10 −mysql> create table DemoTable1332    -> (    -> Number int(10) ZEROFILL NOT NULL DEFAULT 0    -> ); Query OK, 0 ... Read More

CharEnumerator.MoveNext() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:52:44

386 Views

The CharEnumerator.MoveNext() method in C# is used to increments the internal index of the current CharEnumerator object to the next character of the enumerated string.Syntaxpublic bool MoveNext ();Let us now see an example to implement the CharEnumerator.MoveNext() method −Exampleusing System; public class Demo {    public static void Main(){   ... Read More

How do I use the @ sign in MySQL?

AmitDiwan

AmitDiwan

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

456 Views

To use the @ sign, use MySQL SET command. The @sign is used to set user-defined variables. Following is the syntax −SET @anyVariableName:=yourValue;Let us first create a table −mysql> create table DemoTable1331    -> (    -> Id int,    -> Name varchar(20)    -> ); Query OK, 0 rows ... Read More

How do I format a number as decimal to store it in MySQL?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 06:48:12

201 Views

You do not need to format a number in MySQL, for this use DECIMAL data type. Let us first create a table −mysql> create table DemoTable1330    -> (    -> Amount DECIMAL(10, 2)    -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using ... Read More

CharEnumerator.GetType() Method in C#

AmitDiwan

AmitDiwan

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

41 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

296 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

930 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

366 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

136 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

Advertisements