This is a discussion on How to treat 'show tables' as Select? within the MySQL Database forums, part of the Database Forums category; I want to get metadata about table and column names. When using mysql4, this can be done with 'show tables' ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I want to get metadata about table and column names. When using
mysql4, this can be done with 'show tables' and 'desc table'. But i would like to treat these commands as Select statements so i can combine it with more sql, like where, limit, count, order by, etc. For example something like: select (show tables) where table like '%abc%' limit 10; or for Desc only get the name and datatype: select Field, Type from (desc table); Anyone know a syntax that allows me to accomplish this? thanks |
|
|||
|
bent@lortemail.dk wrote:
> I want to get metadata about table and column names. When using > mysql4, this can be done with 'show tables' and 'desc table'. But i > would like to treat these commands as Select statements so i can > combine it with more sql, like where, limit, count, order by, etc. > > For example something like: > select (show tables) where table like '%abc%' limit 10; > > or for Desc only get the name and datatype: > select Field, Type from (desc table); > > Anyone know a syntax that allows me to accomplish this? > > thanks About 2 weeks ago someone asked exactly the same question on this very group. I'm amazed that the search you did before asking this question did not find it! |
|
|||
|
> > About 2 weeks ago someone asked exactly the same question on this very > group. > > I'm amazed that the search you did before asking this question did not find > it! Yes, i have searched thoroughly regarding this subject before posting.... Maybe you did not read or understand the question in my post at all? In any case comments like yours now make another populated thread on this issue with no solution, thereby making it even harder to search and find the answer for others. So, answers and suggestions to my post are welcome... but the smart- ass comments you can keep to yourself, sir. |
|
|||
|
On Sat, 23 Jun 2007 08:18:08 -0700, bent@lortemail.dk wrote:
> >> >> About 2 weeks ago someone asked exactly the same question on this very >> group. >> >> I'm amazed that the search you did before asking this question did not find >> it! > >Yes, i have searched thoroughly regarding this subject before >posting.... >Maybe you did not read or understand the question in my post at all? > >In any case comments like yours now make another populated thread on >this issue with no solution, thereby making it even harder to search >and find the answer for others. > >So, answers and suggestions to my post are welcome... but the smart- >ass comments you can keep to yourself, sir. try: Message-ID: <5d55kpF32i5luU1@mid.dfncis.de> Subject: Treat results of SHOW STATUS as table -- ( Kees ) c[_] The only reason some people get lost in thought is because it's unfamiliar territory. (Paul Fix) (#92) |
|
|||
|
Kees Nuyt wrote:
> On Sat, 23 Jun 2007 08:18:08 -0700, bent@lortemail.dk wrote: > >> >>> >>> About 2 weeks ago someone asked exactly the same question on this >>> very group. >>> >>> I'm amazed that the search you did before asking this question did >>> not find it! >> >> Yes, i have searched thoroughly regarding this subject before >> posting.... >> Maybe you did not read or understand the question in my post at all? >> >> In any case comments like yours now make another populated thread on >> this issue with no solution, thereby making it even harder to search >> and find the answer for others. >> >> So, answers and suggestions to my post are welcome... but the smart- >> ass comments you can keep to yourself, sir. > > try: > Message-ID: <5d55kpF32i5luU1@mid.dfncis.de> > Subject: Treat results of SHOW STATUS as table But Kees, that is precisely the thread that I tried to direct the OP to! You are brave to try again! |