Nishtha Thakur has Published 495 Articles

Java DatabaseMetaData getMaxColumnsInOrderBy() method with example.

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

92 Views

The getMaxColumnsInOrderBy() method of the DatabaseMetaData interface is used to find out the maximum number of columns that the underlying database allows in an ORDER BY clause.This method returns an integer value, representing the maximum number of columns allowed in an ORDER BY clause. If this value is 0 it ... Read More

Pull row with lowest number in a MySQL column?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

123 Views

Use aggregate function MIN() along with GROUP BY for this. Here, we will display the minimum ID for NumberOfProduct . Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    NumberOfProduct int    ); Query OK, 0 rows affected ... Read More

Select all duplicate MySQL rows based on one or two columns?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

558 Views

For this, use subquery along with HAVING clause. Let us first create a table −mysql> create table DemoTable    (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentFirstName varchar(20),    StudentLastName varchar(20)    ); Query OK, 0 rows affected (0.27 sec)Insert some records in the table using insert ... Read More

Java DatabaseMetaData getMaxConnections() method with example.

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

353 Views

The getMaxConnections() method of the DatabaseMetaData interface is used to find out the maximum number of connections that the underlying database allows at a time.This method returns an integer value, representing the maximum number of connections allowed at a time. If this value is 0 it indicates that there is no ... Read More

MySQL Stored Procedure to create a table?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

3K+ Views

Following is the query to create a stored procedure that creates a table. Here, we are creating a table with three columns, one of them is Id −mysql> DELIMITER //    mysql> CREATE PROCEDURE Stored_Procedure_CreatingTable()    BEGIN       create table DemoTable       (       ... Read More

Java DatabaseMetaData getMaxStatementLength() method with example.

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

125 Views

The getMaxStatementLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in a single SQL statement.This method returns an integer value, representing the maximum number of characters allowed in an SQL statement. If this value is 0 it indicates ... Read More

MySQL Select when a grouped record has multiple matching strings?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

121 Views

You can use regular expression for this. Let us first create a table −mysql> create table DemoTable    (    ProductId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ProductName varchar(20)    ); Query OK, 0 rows affected (0.19 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

Fetch data between two rows in MySQL?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

466 Views

To fetch data between two rows, use the concept of LIMIT. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(10)    ); Query OK, 0 rows affected (0.22 sec)Insert some records in the table using insert ... Read More

Java DatabaseMetaData getMaxCursorNameLength() method with example.

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

78 Views

The getMaxCursorNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a cursor.This method returns an integer value, representing the maximum number of characters allowed in a cursor name. If this value is 0 it ... Read More

How can we sort a query using ORDER BY CASE WHEN REGEXP?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:26

635 Views

Use regular expression along with CASE statement. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Value varchar(20)    ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

Advertisements