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
Name few of the dcl commands in sql?
Can a database be shrunk to 0 bytes, if not, why?
What is tempdb database? : SQL Server Architecture
What is bookmark link in ssrs?
What is usually the first word in a sql query?
Can two tables share the same primary key?
When we should use @@error?
What will be the maximum number of index per table?
How do you handle datasets larger than 50 gb?
What are system databases into sql server (2005/2008)?
What is stored in the mssqlsystemresource database? : sql server database administration
How to create an multi-statement table-valued function?
How to return the date part only from a sql server datetime datatype?
What is a self join in sql server?
How to enable tcp/ip protocol on a sql server?