group by with 3 diffrent

Posted by NN on Stack Overflow See other posts from Stack Overflow or by NN
Published on 2010-05-03T10:56:32Z Indexed on 2010/05/03 11:08 UTC
Read the original article Hit count: 208

Filed under:
|
|
|
|

I have 2 table and I wanna a query with 3 column result

in on of them 2 column with view count and title name and in the other 1 column with type_ and i wanna to grouping type_ with max(view count) and show the them title

but i didn't have any idea about grouping expression.

i think we can solve in by using sub query but i don't know which column use in group by.

2 table join with this expression class pk=resource key

i exam this query:

SELECT t.title,j.type_ FROM tags asset t,journal article j
where type_ in (select type_
from journal article,tags asset where class pk=resource  key
group by type_)

but the answer was wrong

© Stack Overflow or respective owner

Related posts about mysql

Related posts about query