+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / select News Count with TagName

select News Count with TagName

3 posts, 0 answered
  1. Bachar Zeidan
    Bachar Zeidan avatar
    67 posts
    Registered:
    01 Jul 2010
    24 Sep 2010
    Link to this post
    Hello Telerik Team,
    how to create e query to select News Count with specific TagName!
    something like
    Select count(*) from table name where tagName='MyspecificTagName'

    thank you very much
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Sep 2010
    Link to this post
    Hi Bachar Zeidan,

    I believe that this is a pure SQL. You cannot get the count directly by Name, because the CmsTaggedContent table does not contain the name of the tag. If you use the ID as identifier you can query CmsTaggedContent, otherwise you have to perform JOIN before making a count

    SELECT
    [sf_CmsTag].[ID],
    [sf_CmsTag].[TagName]
    From [sf_CmsTag] JOIN [sf_CmsTaggedContent] ON
    [sf_CmsTag].ID = [sf_CmsTaggedContent].[TagID]
    WHERE
    [sf_CmsTag].[TagName] = 'NewTag'




    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Bachar Zeidan
    Bachar Zeidan avatar
    67 posts
    Registered:
    01 Jul 2010
    24 Sep 2010
    Link to this post
    thank you very much for your support!
Register for webinar
3 posts, 0 answered