Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What are the features of Embedded SQL

0 Answers   HCL,


system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:28.513 if i write "select dateadd(dd,2,getdate()) ".it returns "2009-01-26 19:59:38.340"...my question is dat could it be possible to retrive da date in da format "26 jan 2009 ...."??

8 Answers  


What are the difficulties faced in cube development? : sql server analysis services, ssas

0 Answers  


How does using a separate hard drive for several database objects improves performance right away?

0 Answers  


what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1;

13 Answers   Patni,


What type of Index will get created after executing the above statement?

0 Answers  


What is the use of CASCADE CONSTRAINTS?

3 Answers  


Can we create clustered index on non primary key column

20 Answers   ABC, CTS,


How to work on DTS?what is the main requirement?

1 Answers   Getit, ivan,


What is raid and what are different types of raid levels?

0 Answers  


What is indexed view? How to create it?

0 Answers  


How to change the data type of an existing column with "alter table" statements in ms sql server?

0 Answers  


Categories