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

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


Please Help Members By Posting Answers For Below Questions

What happens if strings are casted into wrong code pages in ms sql server?

1068


Explain “@@rowcount” and “@@error” in sql server?

1011


Define clusters?

1008


Which are new data types introduced in sql server 2008?

998


What are Spatial data types in SQL Server 2008

975


Explain what is the difference between union and union all?

958


What is the difference between drop table and truncate table?

882


can an order by clause be used in a creation of a view?

1115


what is hash nonclustered index

919


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

930


What are the drawbacks of reporting in ssrs?

145


What is a DBMS, query, SQL?

1005


What is scheduled job and how to create it?

931


Suggest a method of joining two tables.

1110


How do I find the transaction log size in sql server?

925