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

Name few of the dcl commands in sql?

951


Can a database be shrunk to 0 bytes, if not, why?

1036


What is tempdb database? : SQL Server Architecture

1110


What is bookmark link in ssrs?

232


What is usually the first word in a sql query?

1068


Can two tables share the same primary key?

855


When we should use @@error?

904


What will be the maximum number of index per table?

950


How do you handle datasets larger than 50 gb?

162


What are system databases into sql server (2005/2008)?

952


What is stored in the mssqlsystemresource database? : sql server database administration

986


How to create an multi-statement table-valued function?

938


How to return the date part only from a sql server datetime datatype?

1021


What is a self join in sql server?

1051


How to enable tcp/ip protocol on a sql server?

1090