I want to return the count of a tag in a sub routine that corresponds to single result set like so.
SELECT sys_Objects_Tags.TagID, sys_Tags.TagName,
(SELECT COUNT(*)
FROM sys_Objects_Tags
INNER JOIN sys_Tags ON sys_Objects_Tags.TagID = sys_Tags.TagID
WHERE sys_Objects_Tags.SystemObjectID = @BlogID
GROUP BY sys_Objects_Tags.TagName
) Count // <- this column here need to be called "Count" I just need the count here of how many times the tag occures
From sys_Objects_Tags
INNER JOIN sys_Tags ON
sys_Objects_Tags.TagID = sys_Tags.TagID
WHERE sys_Objects_Tags.SystemObjectID = @BlogID AND
sys_Objects_Tags.SystemObjectRecordID = @BlogEntryID
AND sys_Objects_Tags.TableName = 'Blog'
GROUP BY sys_Objects_Tags.TagID, sys_Tags.TagName
kirkdm01
Member
6 Points
67 Posts
Multi SELECT statement problem subquery issue need help urgently
Jul 09, 2010 04:57 AM|LINK
I want to return the count of a tag in a sub routine that corresponds to single result set like so.
SELECT sys_Objects_Tags.TagID, sys_Tags.TagName, (SELECT COUNT(*) FROM sys_Objects_Tags INNER JOIN sys_Tags ON sys_Objects_Tags.TagID = sys_Tags.TagID WHERE sys_Objects_Tags.SystemObjectID = @BlogID GROUP BY sys_Objects_Tags.TagName ) Count // <- this column here need to be called "Count" I just need the count here of how many times the tag occures From sys_Objects_Tags INNER JOIN sys_Tags ON sys_Objects_Tags.TagID = sys_Tags.TagID WHERE sys_Objects_Tags.SystemObjectID = @BlogID AND sys_Objects_Tags.SystemObjectRecordID = @BlogEntryID AND sys_Objects_Tags.TableName = 'Blog' GROUP BY sys_Objects_Tags.TagID, sys_Tags.TagNamespiroff
Member
219 Points
120 Posts
Re: Multi SELECT statement problem subquery issue need help urgently
Jul 09, 2010 11:32 PM|LINK
Hi Sir ,
can give us a schema about the fields those you're working on .
Hong-Gang Ch...
All-Star
74696 Points
6768 Posts
Re: Multi SELECT statement problem subquery issue need help urgently
Jul 14, 2010 11:53 AM|LINK
Please refer this areticle, I think it can help you solve this issue,
http://forge.mysql.com/wiki/TagSchema
If you have any feedback about my replies,please contactmsdnmg@microsoft.com.
Microsoft One Code Framework