Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 PLEASE HELP WITH QUERRY

Author  Topic 

Terrywanja
Starting Member

2 Posts

Posted - 2014-03-19 : 17:48:17
(Removed due to DMCA complaint)

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-03-19 : 18:48:30
Sorry this doesn't help with your question, but if you wanted to have some fun, you should tell your teacher that there is no such thing as a record in an RDBMS and see what they say.
Go to Top of Page

VeeranjaneyuluAnnapureddy
Posting Yak Master

169 Posts

Posted - 2014-03-20 : 00:50:40
select distinct id as author_id,name as author_name,
case when Name is not null and a.id = 1 then 3 else 0 end as h_index
from author as a
left join publication as p
on a.id = p.author_id
order by h_index desc,id desc


Veera
Go to Top of Page

maunishq
Yak Posting Veteran

71 Posts

Posted - 2014-03-20 : 13:05:00
The logic for H-Index would be somewhat like this:
MAX(Cited) <= COUNT(Title) OVER (Partition by Author_ID ORDER BY Author_ID Desc)
And then do as Veera suggested above.

=======================
Not an Expert, Just a learner.
!_(M)_!
Go to Top of Page
   

- Advertisement -