Re: Count Fields of a Table

2006-09-22 Thread Ivan Aleman

[...]

Is there any way to find out, using only plain SQL, the number of fields
of a given table.

describe gives me the number of fields as result, but I need to get only
that.

Is it possible?

Is it also possible to get only the fields name?


AFIK there's no easy way to accomplish this using just plain SQL.
Every time you use DESCRIBE tbl_name you get the number of columns
counted as rows.

You can also use

SHOW COLUMNS FROM tbl_name
SHOW FIELDS FROM tbl_name

And from the shell you can also type

mysqlshow -u myuser -p db_name tbl_name


--
Iván Alemán ~ [[ Debian (Sid) ]] ~
-BEGIN GEEK CODE BLOCK-
Version: 3.12
G!GCM d+ s: a? C+++ UL++ P L$ E--- W+++ N* o--- K- w O- M+ V--
PS++ PE-- Y PGP+++ t-- 5 X R+ !tv b++ DI-- D+++ G+ e++ h* r+ z**$
--END GEEK CODE BLOCK--
bonovoxmofo.blogspot.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Count Fields of a Table

2006-09-22 Thread Ivan Aleman

Hello,
@Mr. Price and Mr. Sims

Thank you for show me the way, your tips where very educational.

Thanks again.

--
Iván Alemán ~ [[ Debian (Sid) ]] ~
-BEGIN GEEK CODE BLOCK-
Version: 3.12
G!GCM d+ s: a? C+++ UL++ P L$ E--- W+++ N* o--- K- w O- M+ V--
PS++ PE-- Y PGP+++ t-- 5 X R+ !tv b++ DI-- D+++ G+ e++ h* r+ z**$
--END GEEK CODE BLOCK--
bonovoxmofo.blogspot.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]