Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Write a SQL SELECT query that only returns each name only once from a table?
Home
Sql
Write a SQL SELECT query that only returns each name only once from a table?
+1
vote
asked
Jul 10, 2020
in
Sql
by
SakshiSharma
Write a SQL SELECT query that only returns each name only once from a table?
#sql-select
#select-sql
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jul 10, 2020
by
sharadyadav1986
To get the result as each name only once, we need to use the DISTINCT keyword.
SELECT DISTINCT name FROM table_name;
Your comment on this answer:
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Related questions
0
votes
Q: Write the SQL query to get the third maximum salary of an employee from a table named employees.
asked
Nov 8, 2021
in
Sql
by
rajeshsharma
sql-query
0
votes
Q: How to write a query to show the details of a student from Students table whose name start with K?
asked
Jul 7, 2020
in
Sql
by
Robindeniel
#sql-query
0
votes
Q: What is the SELECT statement?
asked
Dec 14, 2020
in
Sql
by
SakshiSharma
#select-statement
#sql-select
0
votes
Q: SQL INSERT INTO SELECT Statement
asked
Sep 9, 2019
in
Spark Sql
by
ivor2019
#sql
#sql-syntax
#sql-select
#sql-query
#sql-database
#sql-reference
#sql-tutoial
#sql-programming
#sql-intro
#sql-commands
#sql-excesise
#sql-certificate
0
votes
Q: SQL SELECT INTO Statement
asked
Sep 9, 2019
in
Spark Sql
by
ivor2019
#sql
#sql-syntax
#sql-select
#sql-query
#sql-database
#sql-reference
#sql-tutoial
#sql-programming
#sql-intro
#sql-commands
#sql-excesise
#sql-certificate
0
votes
Q: SQL SELECT DISTINCT Statement
asked
Sep 9, 2019
in
Spark Sql
by
ivor2019
#sql
#sql-syntax
#sql-select
#sql-query
#sql-database
#sql-reference
#sql-tutoial
#sql-programming
#sql-intro
#sql-commands
#sql-excesise
#sql-certificate
0
votes
Q: SQL SELECT Statement
asked
Sep 9, 2019
in
Spark Sql
by
ivor2019
#sql
#sql-syntax
#sql-select
#sql-query
#sql-database
#sql-reference
#sql-tutoial
#sql-programming
#sql-intro
#sql-commands
#sql-excesise
#sql-certificate
0
votes
Q: Write an Oracle SQL query to ensure only users with the manager role can insert rows into the performance_reviews table.
asked
Jan 23
in
Oracle
by
SakshiSharma
oraclesqlquery
0
votes
Q: An SQL query to delete a table from the database and memory while keeping the structure of the table intact?
asked
Dec 15, 2020
in
Sql
by
SakshiSharma
#sql-delete
#delete-database
0
votes
Q: How to select random rows from a table in SQL?
asked
Jul 10, 2020
in
Sql
by
SakshiSharma
#sql-random-rows
#select-random-row-sql
...