Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Jan 2009 at 21:44 UTC
Updated:
14 Jul 2009 at 13:33 UTC
Hello!
Nowdays I making my website, whichone needs a tabled list of bloggers' and blog entries stats. Designed headers are: author (linked authors' blog view), last entry (title, node link), posted (datetime), count of entries (integer).
Now installed the Views Calc to hack a subquery in to the result qurey. I know, it's ugly think - but(!) it generates this query:
SELECT distinct users.name AS users_name,
(SELECT COUNT(node.nid) FROM _spdr2_node node, _spdr2_users users
WHERE (users.uid = node.uid) AND (users.name = users_name) AND (node.status <> 0) AND (node.type IN ('blog'))) AS cid2
FROM _spdr2_node node
INNER JOIN _spdr2_users users ON node.uid = users.uid
WHERE (node.status <> 0) AND (node.type in ('blog'))
ORDER BY users_name
So, it's works. But it's ugly and expensive (not optimal). I will make the other two views calc field based on the subselect, and view displays what I think.
My question is: Do you have any other ideas to goal my designed result? Any tips will be wellcomed.
Thanks your response,
prometheus
Comments
Comment #1
prom3theus commentedI'm sorry for that, but I miscalculated me on the generated view query. So this way isn't the way for solve my problem. Details below...
Fields are:
Result table is:
Generated query is:
On the result table you can see a replace bug in column "Author" and "Last Entry" (custom link fields was not replaced by calculated fields value in result). And distinct not available for "User: Name" field, only to "Node: Nid" but "User: Name" is the first field in list...
So now i'm totally confused.
Comment #2
merlinofchaos commentedI'm not sure what to say. it seems like maybe this should go in the views calc queue.
Comment #3
domesticat commentedClosed while closing all Views support requests with no activity for 6 months. If you still need help, you may re-open this issue at any time.