MySQL Forums
Forum List  »  Newbie

CAST as CHAR on multiple records
Posted by: David Donahue
Date: March 25, 2005 10:34AM

I have a SELECT statement which casts a Text field to Char (for proper conversion in the software that calls it):

SELECT
Website_Rants.RID RID,
Website_Rants.Title Title,
CAST(Website_Rants.Body AS CHAR) Body,
Website_Rants.Date Date,
COUNT(Website_RantComments.RCID) Comments
FROM
Website_Rants
LEFT OUTER JOIN Website_RantComments ON Website_Rants.RID = Website_RantComments.RID
GROUP BY
Website_Rants.RID

Now, when there is only 1 record in the resulting data, the conversion works fine. But when more than 1 record is returned, the cast doesn't seem to work and the field is still of type Text. Am I doing something wrong? How can I make this work on every record that is returned? Is there a better way to accomplish this?


Regards,
David P. Donahue
ddonahue@ccs.neu.edu

Options: ReplyQuote


Subject
Written By
Posted
CAST as CHAR on multiple records
March 25, 2005 10:34AM


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.