Wednesday, March 7, 2012

can anyone tell me why the following sql does not work?

SELECT H.id, H.CategoryID ,H.Image ,H.StoryId ,H.Publish, H.PublishDate, H.Date ,H.Deleted ,SL.ListTitle,C.CategoryTitle

FROM HomePageImage H

JOIN shortlist SL on H.StoryId = SL.id

(INNER JOIN category C on H.CategoryId = C.CategoryId)

order by date DESC

I'm not sure what you mean by "does not work" and you didn't post an error message.

However, it's possible you are using the reserved word Date in the order by clause.

Did you mean "order by PublishDate DESC"?

|||it saysIncorrect syntax near the keyword 'INNER'.|||

Try to remove the brace that encloses Inner Join and your statement will work fine

Hope my suggestion helps

|||

thanks

No comments:

Post a Comment