Perform Case-Insensitive SELECT Using MySQL

AmitDiwan
Updated on 10-Dec-2019 06:43:45

274 Views

Let us first create a table −mysql> create table DemoTable1460    -> (    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.91 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1460 values('Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable1460 values('David'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable1460 values('Bob'); Query OK, 1 row affected (0.52 sec) mysql> insert into DemoTable1460 values('Robert'); Query OK, 1 row affected (0.11 sec)Display all records from the table using select statement −mysql> select * from DemoTable1460;This will produce the following ... Read More

Get ICollection Containing Values in Hashtable in C#

AmitDiwan
Updated on 10-Dec-2019 06:42:56

128 Views

To get an ICollection containing the values in the Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       Hashtable hash = new Hashtable();       hash.Add("A", "Electronics");       hash.Add("B", "Appliances");       hash.Add("C", "Pet Supplies");       hash.Add("D", "Books");       hash.Add("E", "Toys");       hash.Add("F", "Footwear");       hash.Add("G", "Clothing");       ICollection col = hash.Keys;       foreach(string str in col)       Console.WriteLine(str + ": " + hash[str]);    } }OutputThis ... Read More

Get ICollection Containing Keys in Hashtable (C#)

AmitDiwan
Updated on 10-Dec-2019 06:40:14

184 Views

To get an ICollection containing the keys in the Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       Hashtable hash = new Hashtable();       hash.Add("A", "Electronics");       hash.Add("B", "Appliances");       hash.Add("C", "Pet Supplies");       hash.Add("D", "Books");       hash.Add("E", "Toys");       hash.Add("F", "Footwear");       hash.Add("G", "Clothing");       ICollection col = hash.Keys;       foreach(string str in col)       Console.WriteLine(str + ": " + hash[str]);    } }OutputThis ... Read More

Use UNION ALL to Insert Records in Two Tables with a Single Query in MySQL

AmitDiwan
Updated on 10-Dec-2019 06:38:17

975 Views

Here is the query to create first table.mysql> create table DemoTable1    -> (    -> StudentName varchar(20),    -> StudentMarks int    -> ); Query OK, 0 rows affected (0.67 sec)To understand the above concept, let us create second table.mysql> create table DemoTable2    -> (    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2 values('Chris'); Query OK, 1 row affected (0.12 sec)Display all records from the table using select statement −mysql> select * from DemoTable2;This will produce the following output −+-------+ ... Read More

Difference Between innerWidth and outerWidth in jQuery

Alex Onsman
Updated on 10-Dec-2019 06:37:56

318 Views

innerWidth in jQueryThe innerWidth() returns the inner width of the first matched element. It includes padding, but not border and margin.ExampleYou can try to run the following code to get the inner width in jQuery:Live Demo $(document).ready(function(){     $("button").click(function(){         alert("Inner Width of div element: " + $("div").innerWidth());     }); }); Get Inner Width of div outerWidth in jQueryThe outerWidth() returns the outer width of the first matched element. It includes padding and border.ExampleYou can try to run the following code to ... Read More

Get Value of the Bit at a Specific Position in BitArray in C#

AmitDiwan
Updated on 10-Dec-2019 06:36:57

229 Views

To get value of the bit at a specific position in BitArray, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       BitArray arr1 = new BitArray(2);       BitArray arr2 = new BitArray(2);       arr1[0] = false;       arr1[1] = true;       Console.WriteLine("BitArray1 length = "+arr1.Length);       Console.WriteLine("BitArray1 first element = "+arr1.Get(0));       arr2[0] = false;       arr2[1] = true;       Console.WriteLine("BitArray2 length = "+arr2.Length);       Console.WriteLine("Elements in BitArray2..."); ... Read More

Difference Between innerHeight and outerHeight in jQuery

Alex Onsman
Updated on 10-Dec-2019 06:35:49

458 Views

innerHeight in jQueryThe innerHeight() method gets the inner height (excludes the border and includes the padding) for the first matched element.ExampleYou can try to run the following code to learn how to work with innerHeight in jQuery:Live Demo           jQuery innerHeight() method                              $(document).ready(function() {                         $("div").click(function () {                var color = $(this).css("background-color");                var height ... Read More

Get or Set Value in Hashtable in C#

AmitDiwan
Updated on 10-Dec-2019 06:33:58

192 Views

To get or set the value associated with specified key in Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       Hashtable hash = new Hashtable();       hash.Add("1", "AB");       hash.Add("2", "BC");       hash.Add("3", "DE");       hash.Add("4", "EF");       hash.Add("5", "GH");       hash.Add("6", "IJ");       hash.Add("7", "KL");       hash.Add("8", "MN");       hash.Add("9", "OP");       hash.Add("10", "QR");       Console.WriteLine("Value at key 3 = "+hash["3"]);   ... Read More

jQuery Offset Method Explained

Alex Onsman
Updated on 10-Dec-2019 06:33:02

159 Views

The offset() method gets the current offset of the first matched element, in pixels, relative to the document.ExampleYou can try to run the following code to learn how to use offset() method in jQuery:Live Demo           jQuery offset() method                              $(document).ready(function() {                         $("div").click(function () {                var offset = $(this).offset();                $("#lresult").html("left offset: " + offset.left + ".");                $("#tresult").html("top offset: " + offset.top + ".");             });                          });                              div {              width:60px;              height:60px;              margin:5px;              float:left;          }                             Click on any square:                                                        

Ignore Null Values in MySQL and Display Remaining Values

AmitDiwan
Updated on 10-Dec-2019 06:32:49

2K+ Views

Use IS NOT NULL to find the non-null values and display them. Let us first create a table −mysql> create table DemoTable1458    -> (    -> StudentName varchar(20),    -> StudentScore int    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1458 values('Chris Brown', 56); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable1458 values('David Miller', NULL); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1458 values('John Doe', 78); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable1458 values('Adam Smith', NULL); ... Read More

Advertisements