On Tue, Jul 30, 2002 at 01:45:59PM +0900, Takanori Ugai wrote:
> Dear Folks,
> 
> I'm not sure this is a bug or the SQL syntax.
> I created a db named a-b that includes a hyphen.
> 
> % mysql a-b
> mysql> show tables ;
> +-------------------------+
> | Tables_in_a-b           |
> +-------------------------+
> | a                       |
> | b                       |
> +-------------------------+
> 7 rows in set (0.00 sec)
> 
> mysql> show tables from a-b ;
> ERROR 1064: You have an error in your SQL syntax near 'a-b' at line 1
> 
> I think the syntax should accept such a DB's name and this is a bug.
> Anybody knows how the SQL should handle the hyphen?

Quote it:

  mysql> show tables from `a-b`;

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

MySQL 3.23.51: up 61 days, processed 1,271,831,535 queries (240/sec. avg)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to