AmitDiwan has Published 10744 Articles

MySQL random rows sorted by a specific column name?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:17:29

302 Views

Let us first create a table −mysql> create table DemoTable1339    -> (    -> Name varchar(30),    -> Score int    -> ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1339 values('Chris', 56); Query OK, 1 row affected ... Read More

Tuple Class in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:17:27

141 Views

The Tuple class represents a 3-tuple, which is called triple. A tuple is a data structure that has a sequence of elements.It is used in −Easier access to a data set.Easier manipulation of a data set.To represent a single set of data.To return multiple values from a methodTo pass multiple ... Read More

Count values based on conditions and display the result in different columns with MySQL?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:15:06

147 Views

Let us first create a table −mysql> create table DemoTable1485     -> (     -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,     -> StudentName varchar(20),     -> StudentSubject varchar(20)     -> ); Query OK, 0 rows affected (0.72 sec)Insert some records in the table ... Read More

jQuery :empty Selector

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:13:15

251 Views

The :empty selector in jQuery is used to select all elements which are empty.SyntaxThe syntax is as follows −$(":empty")ExampleLet us now see an example to implement the :empty() selector −    .demo {       color: brown;       background-color: orange;       font-size: ... Read More

Using MySQL where clause and ordering by avg() to find the average of duplicate individual elements

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:12:03

239 Views

For this, use having clause instead of where. Let us first create a table −mysql> create table DemoTable1338    -> (    -> Name varchar(10),    -> Score int    -> ); Query OK, 0 rows affected (1.54 sec)Insert some records in the table using insert command. Here, we have ... Read More

Tuple Class in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:11:46

118 Views

The Tuple class represents a 1-tuple, which is called singleton. A tuple is a data structure that has a sequence of elements.It is used in −Easier access to a data set.Easier manipulation of a data set.To represent a single set of data.To return multiple values from a methodTo pass multiple ... Read More

Fetch maximum value from a column with values as string numbers like Value440, Value345, etc. in SQL

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:08:47

98 Views

For this, you can use MAX() along with substring(). Let us first create a table −mysql> create table DemoTable1337    -> (    -> Value varchar(50)    -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1337 values('Value400'); Query ... Read More

Tuple Class in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 07:08:31

265 Views

If you want to return more than one value from a class method, then use C# Tuples. To create tuples in C#< this class provides a static method. Tuples introduced in .NET 4.0.ExampleLet us now see an example to implement Tuple in C# −using System; public class Demo {   ... Read More

jQuery :disabled Selector

AmitDiwan

AmitDiwan

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

293 Views

The :disabled() selector in jQuery is used to select all disabled input elements.SyntaxThe syntax is as follows −$(":disabled")ExampleLet us now see an example to implement the :disabled() selector −    .one {       color: brown;       background-color: orange;       font-size: 16px; ... Read More

Display all grants of a specific user in MySQL

AmitDiwan

AmitDiwan

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

173 Views

Let us first display all usernames along with host name −mysql> select user, host from MySQL.user;This will produce the following output −+------------------+-----------+ | user             | host      | +------------------+-----------+ | Bob              | %         ... Read More

Advertisements