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 happens if strings are casted into wrong code pages in ms sql server?
Explain “@@rowcount” and “@@error” in sql server?
Define clusters?
Which are new data types introduced in sql server 2008?
What are Spatial data types in SQL Server 2008
Explain what is the difference between union and union all?
What is the difference between drop table and truncate table?
can an order by clause be used in a creation of a view?
what is hash nonclustered index
you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration
What are the drawbacks of reporting in ssrs?
What is a DBMS, query, SQL?
What is scheduled job and how to create it?
Suggest a method of joining two tables.
How do I find the transaction log size in sql server?