How to select Distinct columns from the table, table having
20 columns and i want all coulmns
Answer Posted / 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 |
Post New Answer View All Answers
What do you mean by authentication modes in sql server?
What are the benefits of filtered indexes?
What are the differences between triggers and stored procedures?
What is data file in computer?
What are the instances when triggers are appropriate?
After removing a table from database, what other related objects have to be dropped explicitly?
Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?
How to rebuild indexes with alter index ... Rebuild?
what is a transaction and what are acid properties? : Sql server database administration
What is a database in ms sql server?
What is difference between rownum and row_number?
What is the chart in report?
What is delete query?
You are designing a strategy for synchronizing an SQL Azure database and multiple remote Microsoft SQL Server 2008 databases. The SQL Azure database contains many tables that have circular foreign key relationships?
How many types of cursor type are there?