List columns in a table
Writing by shivdev on Tuesday, 15 of January , 2013 at 10:27 pm
For, Oracle
-- This is Case Sensitive SELECT column_name, data_type FROM user_tab_cols WHERE UPPER(table_name) = UPPER('MY_TABLE')
For, MySQL, you can either do a desc my_table or
SHOW COLUMNS FROM my_table
For SQL Server
SELECT * FROM information_schema.columns WHERE table_name = 'my_table'
Leave a comment
Category: SQL DB
- Add this post to
- Del.icio.us -
- Digg -
- -
- Tweet -
-
-
No Comments
No comments yet.
Leave a comment
You must be logged in to post a comment.