How to select Distinct columns from the table, table having
20 columns and i want all coulmns

Answers were Sorted based on User's Feedback



How to select Distinct columns from the table, table having 20 columns and i want all coulmns..

Answer / amit

select distinct * from table_name

Is This Answer Correct ?    18 Yes 7 No

How to select Distinct columns from the table, table having 20 columns and i want all coulmns..

Answer / latha.s

select distinct * from tablename;

Is This Answer Correct ?    6 Yes 1 No

How to select Distinct columns from the table, table having 20 columns and i want all coulmns..

Answer / ram

select * from tablename
select distinct * from tablename
above two select statements give same output with all
column name and also data
if we want only column name & its details(datatype,sizre)
use

select * from
information_schema.columns where table_name='EMP1'
(or)
select distinct * from
information_schema.columns where table_name='EMP1'

(Here Table name mustbe in single quotes and also capital
letters only)
here also both select statements output is same

Is This Answer Correct ?    0 Yes 0 No

How to select Distinct columns from the table, table having 20 columns and i want all coulmns..

Answer / saleem

select *from tablename gives all distinct columns in the
table

Is This Answer Correct ?    1 Yes 2 No

How to select Distinct columns from the table, table having 20 columns and i want all coulmns..

Answer / monal

To select distinct columns you can mention them in the SQL
query and to select all columns you can use select * from
information_schema.columns

Is This Answer Correct ?    2 Yes 8 No

Post New Answer

More SQL Server Interview Questions

What are some examples of schemas?

0 Answers  


What is cdc in sql server?

0 Answers  


Differentiate between sql temp table vs table variable?

0 Answers  


What do you understand by replication in sql server? Mention the different types of replication in sql server.

0 Answers  


Tell me what is sql profiler?

0 Answers  






What are the lambda triggers?

0 Answers  


Explain the architecture of ms sql reporting service?

0 Answers  


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

0 Answers  


What is sparse columns of sql server 2008?

0 Answers  


As a part of your job, what are the DBCC commands that you commonly use for database maintenance?

1 Answers   HCL,


What is the role that is required for killing a process What is the role that is required for creating a linked server

1 Answers   CarrizalSoft Technologies, IBM,


What is molap and its advantage? : sql server analysis services, ssas

0 Answers  


Categories