Nishtha Thakur has Published 564 Articles

Java DatabaseMetaData getMaxProcedureNameLength() method with example.

Nishtha Thakur

Nishtha Thakur

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

27 Views

The getMaxProcedureNameLength() 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 procedure.This method returns an integer value, representing the maximum number of characters allowed in a procedure name. If this value is 0 it ... Read More

Apostrophe replacement in MySQL query?

Nishtha Thakur

Nishtha Thakur

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

441 Views

To replace apostrophe, you can use replace(). Following is the syntax −update yourTableName set yourColumnName=replace(yourColumnName, '\'', '');Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Sentence varchar(100)    ); Query OK, 0 rows affected (0.17 sec)Insert some records ... Read More

Java DatabaseMetaData getMaxColumnsInOrderBy() method with example.

Nishtha Thakur

Nishtha Thakur

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

23 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

75 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

424 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

256 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

26 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

53 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

356 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

Advertisements