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
How to get the query of a table in sql server?
Which are the important points to note when multilanguage data is stored in a table?
Which tcl commands are available on the sql server?
How to insert stored procedure result into temporary table?
Do you know spatial data types - geometry and geography in sql server 2008?
Does partitioning improve performance?
How to create an inline table-valued function?
Explain the dirty pages?
How to add an address record into adventureworkslt?
What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?
What is mapping schema?
What is a virtual table in sql?
Write the syntax for stuff function in an sql server?
What is the difference between upgrade and migration in sql server?
What is database replication?