AmitDiwan has Published 10744 Articles

Alter a table column from VARCHAR to NULL in MySQL

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 10:15:48

508 Views

To alter, use the ALTER command with CHANGE as in the below syntax −alter table yourTableName change yourColumnName yourColumnName datatype NULL DEFAULT NULL;Let us first create a table −mysql> create table DemoTable1356     -> (     -> FirstName varchar(30)     -> ); Query OK, 0 rows affected ... Read More

MySQL query to return all items in a single row

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 10:14:31

1K+ Views

For this, use GROUP_CONCAT(). Let us first create a table−mysql> create table DemoTable1355     -> (     -> Location text     -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1355 values('E:'); Query OK, 1 row ... Read More

Fix Error 1136: Column count doesn't match value count at row 1?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 10:13:16

2K+ Views

You may get tis value, if you are missing the value for auto_increment column. The error is as follows −mysql> insert into DemoTable1353 values('Chris', 23); ERROR 1136 (21S01): Column count doesn't match value count at row 1You need to provide the value for auto_increment or leave it to automatic generation.Let ... Read More

jQuery :focus Selector

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 10:12:27

516 Views

The :focus selector in jQuery is used to select the element which currently has focus.SyntaxThe syntax is as follows −$(":focus")ExampleLet us now see an example to implement the :focus() selector −    .one {       color: brown;       background-color: orange;       ... Read More

jQuery :first-of-type Selector

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 10:10:07

216 Views

The :first-of-type selector in jQuery is used to select elements, which are the first element of their parent.SyntaxThe syntax is as follows −$(":first-of-type")ExampleLet us now see an example to implement the :first-of-type() selector −    .demo {       background-color: red;       color: white; ... Read More

jQuery :first-child Selector

AmitDiwan

AmitDiwan

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

314 Views

The :first-child selector in jQuery is used to select all elements, which are the first child of their parent.SyntaxThe syntax is as follows −$(":first-child")ExampleLet us now see an example to implement the :first-child() selector −    .demo {       background-color: red;       color: ... Read More

Type.GetFields() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:55:31

289 Views

The Type.GetFields() method in C# is used to get the fields of the current Type.SyntaxFollowing is the syntax −public System.Reflection.FieldInfo[] GetFields ();ExampleLet us now see an example to implement the Type.GetFields() method −using System; using System.Reflection; public class Demo {    public static void Main(){       Type type ... Read More

Type.GetTypeHandle() Method in C#

AmitDiwan

AmitDiwan

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

92 Views

The Type.GetTypeHandle() method in C# is used to get the handle for the Type of a specified object.SyntaxFollowing is the syntax −public static RuntimeTypeHandle GetTypeHandle (object ob);Above, ob is the object for which to get the type handle.Exampleusing System; public class Demo {    public static void Main(){     ... Read More

Type.GetTypeFromHandle() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:50:22

153 Views

The Type.GetTypeFromHandle() method in C# is used to get the type referenced by the specified type handle.SyntaxFollowing is the syntax −public static Type GetTypeFromHandle (RuntimeTypeHandle handle);Above, the handle parameter is the object that refers to the type.ExampleLet us now see an example to implement the Type.GetTypeFromHandle() method −using System; public ... Read More

Decimal.Floor() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:48:00

549 Views

The Decimal.Floor() method in C# rounds a specified Decimal number to the closest integer toward negative infinity.SyntaxFollowing is the syntax −public static decimal Floor (decimal val);Above, Val is the value to round.ExampleLet us now see an example to implement the Decimal.Floor() method −using System; public class Demo {    public ... Read More

Advertisements