Difference between revisions of "What is the syntax to view structure of table?"

From SQLZOO
Jump to: navigation, search
Line 15: Line 15:
 
<source lang='sql' class='def e-sqlserver'>sp_columns @table_name=bbc
 
<source lang='sql' class='def e-sqlserver'>sp_columns @table_name=bbc
 
</source>
 
</source>
<source lang='sql' class='def e-mysql'>show columns from gisq.bbc
+
<source lang='sql' class='def e-mysql'>show columns from bbc
 
</source>
 
</source>
 
<source lang='sql' class='def'>SQL
 
<source lang='sql' class='def'>SQL

Revision as of 09:57, 18 July 2012

What is the syntax to view structure of table?

schema:gisq

What is the syntax to view structure of table?

SELECT * FROM syscat.columns
WHERE tabname= 'BBC'
SELECT * FROM all_tab_columns
 WHERE table_name='BBC'
sp_columns @table_name=bbc
show columns from bbc
SQL