MySQL Forums
Forum List  »  Docs

i need help for Error :1064
Posted by: pradeep kamat
Date: March 06, 2005 10:12PM

Hello,

I am stuck with sql subquery. If I execute both queries separately they works fine. Incase I use them together in subquery it does give me ERROR:1064. Could you please look in to the subquery to tell me what i am going wrong.

SELECT count(a.topic_id),a.topic,a.creator_id,a.modify_date,a.respondant_id FROM messageboard a where a.active='Y' and a.topic_id IN ( SELECT distinct(b.topic_id) FROM messageboard b order by b.topic_id, b.modify_date desc) group by a.topic, a.creator_id, a.modify_date, a.respondant_id;

my database structure is :-

+---------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-------------+------+-----+---------+-------+
| Topic_id | int(11) | | | 0 | |
| Topic | varchar(30) | YES | | NULL | |
| Creator_id | varchar(10) | YES | | NULL | |
| Message | text | YES | | NULL | |
| Respondant_id | varchar(10) | YES | | NULL | |
| Modify_date | datetime | YES | | NULL | |
| Active | char(1) | YES | | NULL | |
+---------------+-------------+------+-----+---------+-------+

Options: ReplyQuote


Subject
Views
Written By
Posted
i need help for Error :1064
3563
March 06, 2005 10:12PM
3180
March 31, 2005 11:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.