carlosarieira1 Posted December 18, 2012 Report Share Posted December 18, 2012 (edited) Alguem sabe de alguma consulta em sql, onde seja possivel ver quais sao os campos chaves de uma determinada tabela?? Edited December 18, 2012 by carlosarieira1 Link to comment Share on other sites More sharing options...
jsWizard Posted December 18, 2012 Report Share Posted December 18, 2012 information schema views: http://dev.mysql.com/doc/refman/5.0/en/information-schema.html key_column_usage inté! Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted December 18, 2012 Report Share Posted December 18, 2012 show keys from `tabela` IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
carlosarieira1 Posted December 18, 2012 Author Report Share Posted December 18, 2012 (edited) vou testar Sim funcionou mas nao da apenas para retiraro nome (Collun_name)?? Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment hotel 0 PRIMARY 1 CodHotel A 4 NULL NULL BTREE Edited December 18, 2012 by carlosarieira1 Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted December 18, 2012 Report Share Posted December 18, 2012 information schema views: http://dev.mysql.com/doc/refman/5.0/en/information-schema.html key_column_usage inté! SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'base de dados' AND TABLE_NAME = 'tabela' AND COLUMN_KEY = 'PRI' IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
jsWizard Posted December 18, 2012 Report Share Posted December 18, 2012 "não dês peixe.. ensina-os a pescar".. mas às vezes nem assim 😄 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now