Thread: Getting all tables which contains a specific column name
Getting all tables which contains a specific column name
From
"Ridvan Lakas ng Bayan S. Baluyos"
Date:
Hi list,
How do I get all the tables which contains a specific column name? For example, I want to get all tables that has an `is_active` column in them?
Thanks,
Ridvan
--
リヅバン バルヨス
ridvan.baluyos@qualservcentral.com
http://ridvan.baluyos.net
http://www.onxiam.com/people/rbaluyos
Registered Linux User #439466
Registered Ubuntu User #16034
Q: Have you heard of the Object-Oriented way to get wealthy?
A: Inheritance.
How do I get all the tables which contains a specific column name? For example, I want to get all tables that has an `is_active` column in them?
Thanks,
Ridvan
--
リヅバン バルヨス
ridvan.baluyos@qualservcentral.com
http://ridvan.baluyos.net
http://www.onxiam.com/people/rbaluyos
Registered Linux User #439466
Registered Ubuntu User #16034
Q: Have you heard of the Object-Oriented way to get wealthy?
A: Inheritance.
In response to Ridvan Lakas ng Bayan S. Baluyos : > Hi list, > > How do I get all the tables which contains a specific column name? For example, > I want to get all tables that has an `is_active` column in them? select table_schema, table_name from information_schema.columns where column_name = 'is_active'; Regards, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
Re: Getting all tables which contains a specific column name
From
"Ridvan Lakas ng Bayan S. Baluyos"
Date:
Ok I got it already.
SELECT table_name
FROM information_schema.columns
WHERE column_name = 'is_active'
ORDER BY ordinal_position;
I don't know if this is correct. Please correct me if I'm wrong.
Thanks,
Ridvan
--
リヅバン バルヨス
ridvan.baluyos@qualservcentral.com
http://ridvan.baluyos.net
http://www.onxiam.com/people/rbaluyos
Registered Linux User #439466
Registered Ubuntu User #16034
Q: Have you heard of the Object-Oriented way to get wealthy?
A: Inheritance.
SELECT table_name
FROM information_schema.columns
WHERE column_name = 'is_active'
ORDER BY ordinal_position;
I don't know if this is correct. Please correct me if I'm wrong.
Thanks,
Ridvan
On Wed, Apr 22, 2009 at 2:45 PM, Ridvan Lakas ng Bayan S. Baluyos <ridvan@baluyos.net> wrote:
Hi list,
How do I get all the tables which contains a specific column name? For example, I want to get all tables that has an `is_active` column in them?
Thanks,
Ridvan
--
リヅバン バルヨス
ridvan.baluyos@qualservcentral.com
http://ridvan.baluyos.net
http://www.onxiam.com/people/rbaluyos
Registered Linux User #439466
Registered Ubuntu User #16034
Q: Have you heard of the Object-Oriented way to get wealthy?
A: Inheritance.
--
リヅバン バルヨス
ridvan.baluyos@qualservcentral.com
http://ridvan.baluyos.net
http://www.onxiam.com/people/rbaluyos
Registered Linux User #439466
Registered Ubuntu User #16034
Q: Have you heard of the Object-Oriented way to get wealthy?
A: Inheritance.