What is the difference between UNIQUE and DISTINCT keywords in DBMS?
First we declare is as primary key and after group by we can get uniqu values.
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
PRIMARY KEY (ID)
);
SELECT ID, LastName,FirstName
FROM Persons
GROUP BY ID, LastName,FirstName;
| Is This Answer Correct ? | 0 Yes | 0 No |
Can we add an identity column to decimal datatype?
What kind of problems occurs if we do not implement proper locking strategy?
What is the difference between cross join and Full outer join?
Can foreign key be deleted?
What is Transaction?
what is the difference between count(*) and count(1) ?
Can we add a cpu to sql server?
Explain what are db_options used for?
CTE(common table expression)
What is difference between order by and group by?
How to return the date part only from a sql server datetime datatype?
how you can list all the tables in a database?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)