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

From SQLZOO
Jump to: navigation, search
(Created page with "What is the syntax to view structure of table? <div class='ht'> <div class=params>schema:gisq</div> <div> What is the syntax to view structure of table? </div> <source lang=sq...")
 
Line 8: Line 8:
 
</source>
 
</source>
 
<source lang='sql' class='def e-db2'>SELECT * FROM syscat.columns
 
<source lang='sql' class='def e-db2'>SELECT * FROM syscat.columns
WHERE tabname= 'CIA'
+
WHERE tabname= 'BBC'
 
</source>
 
</source>
 
<source lang='sql' class='def e-oracle'>SELECT * FROM all_tab_columns
 
<source lang='sql' class='def e-oracle'>SELECT * FROM all_tab_columns
  WHERE table_name='CIA'
+
  WHERE table_name='BBC'
 
</source>
 
</source>
<source lang='sql' class='def e-sqlserver'>sp_columns @table_name=cia
+
<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.cia
+
<source lang='sql' class='def e-mysql'>show columns from gisq.bbc
 
</source>
 
</source>
 
<source lang='sql' class='def'>SQL
 
<source lang='sql' class='def'>SQL

Revision as of 13:39, 17 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 gisq.bbc
SQL
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense