How to find duplicate entry or duplicate row in a table
Filed under: MySQL Interview Questions, Oracle Interview Questions, PostgreSQL Interview Questions, SQL SERVER Interview Questions
In this sql command we are trying to find the duplicate entry with duplicate name. This sql command will give all the MIN id which has duplicate entry
SELECT MIN(id) AS dupid,COUNT(name) AS dupcnt
FROM tablename
GROUP BY name HAVING dupcnt>1
It should work on Oracle, Mysql
Explain about string constants?
String constant contains a sequence of characters bound by single quotes. This feature is used during insertion of a character or passing character to database objects. PostgreSQL allows the usage of single quotes but embedded by a C style backslash. This feature is important in parsing data.
What are the languages which PostgreSQL supports?
Some of the languages which PostgreSQL supports are as follows: -
It supports a language of its own known as PL/pgSQL and it supports internal procedural languages. Pl/pgSQL can be compared to oracle, PL/SQL, etc. Languages such as Perl, Python, TCL can be used as embedded languages.
What are the different data types supported by PostgreSQL?
There are different data types which are supported they are: -
1) Arbitrary precision numeric’s
2) Geometric primitives
3) Arrays
4) XML etc
Users can create their own indexes and make them indexed.
