Jump to content

[Resolvido] consulta dos campos chaves


carlosarieira1

Recommended Posts

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 by carlosarieira1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.