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

How to Display, Amount of Disk Activity Generated by Transact-SQL Statements?

1 Answers  


How to delete the duplicate rows from a table in SQL Server ??

3 Answers  


What is dirty page?

0 Answers  


What is Index Segmentation ?

1 Answers   TCS,


Explain how many normalization forms?

0 Answers  






Explain the various types of concurrency problem?

0 Answers  


there is a trigger defined for insert operations on a table, in an oltp system. The trigger is written to instantiate a com object and pass the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? : Sql server database administration

0 Answers  


Explain the benefits of user-defined functions?

0 Answers  


what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration

0 Answers  


How will you make an attribute not process? : sql server analysis services, ssas

0 Answers  


How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?

0 Answers  


How will you hide an attribute? : sql server analysis services, ssas

0 Answers  


Categories