Problem using Computed Column with MySQL
| From: | Hamid Hossain | Date: | Sun, 13 Jul 2003 03:23:43 +0000 |
| Subject: | Problem using Computed Column with MySQL | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-3617@lists.php.net to get a copy of this message | ||
I want to show my stories categories and number of stories under each category.
I did the following:
SELECT catid, catname, (SELECT COUNT(*) stories FROM story WHERE storycat=catid)
FROM category
I always receive error because of the second SELCET statment. I used to do this in MS-SQL but it seems not working here!
I don't like to create two queries to do the job while it is possible to be in one.
any suggessions?
Regards,
Hamid Hossain
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus