select substring(i.AddedDate,1,10) as Date_Added,
substring(i.ChangedDate,1,10) as Date_Edited, i.*
from
nccs_links.LINKS i
LEFT JOIN nccs_links.Items_topics_xref x ON i.id = x.ItemID and i.isDeleted = 0 and x.isDeleted = 0
LEFT JOIN communityneeds.taggeditem ti ON ti.knowledgebaseId = i.id
LEFT JOIN communityneeds.tag t ON t.id = ti.tagId
WHERE 1 and publish='Y' and i.isDeleted = 0 AND (i.GroupID < 1 || i.GroupID IS NULL) AND (i.ProjectID < 1 || i.ProjectID IS NULL) AND (i.GroupEdit LIKE '' or i.GroupEdit IS NULL) and i.platform = 'nccs'
GROUP BY i.id
ORDER BY i.AddedDate DESC, i.name
LIMIT 100;