SELECT LinkId, Link, Links.Title, Content, NewWindow, Categories.CategoryId, Categories.Name AS CategoryTitle, Description AS CategoryDescription FROM Modules, Categories, CategoryItems, Links WHERE Modules.InternalName = 'links' AND Modules.ModuleId = Categories.ModuleId AND Categories.CategoryId = CategoryItems.CategoryId AND CategoryItems.ItemId = Links.LinkId AND Categories.IncludeInAll ORDER BY Categories.SortOrder, Categories.Name, Links.SortOrder, Links.Title
An expression of non-boolean type specified in a context where a condition is expected, near 'ORDER'.