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
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 |
Answer / saleem
select *from tablename gives all distinct columns in the
table
| Is This Answer Correct ? | 1 Yes | 2 No |
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 |
What is the difference between cube operator and rollup operator? : SQL Server Architecture
you are provided with the single table having say 4 col ie fname lname age city , now the all records with displying of only fname and lname is required but in this format say my name is abhay khanna it will come like this abhay-khanna rahul-roy gaurav-singh the above format is required
Types of Authentications in Sql Server? How user gets authenticated through windows authentication?
How to retrieve error messages using odbc_errormsg()?
Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?
Explain what are the restrictions while creating batches in sql server?
how can you move the master database
two tables with table name ship(name,year) and battle (name,year),how to find the latest added year in the table ship
What does executeupdate return?
What is the difference between update lock and exclusive lock?
What is importing utility?
what is macro?
5 Answers Excel, Global Innovation, Wipro,
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)