Topic on Talk:Quarry

Jump to navigation Jump to search
Summary by 1234qwer1234qwer4

SQL functions are not allowed on Quarry.

1234qwer1234qwer4 (talkcontribs)

My query at keeps failing with Access denied for user 's52788'@'%' to database 'commonswiki_p'. I'm new to SQL, so I might have an error in my code, but two other queries to the same database did work for me.


Matěj Suchánek (talkcontribs)

I am pretty sure SQL functions are not allowed.

1234qwer1234qwer4 (talkcontribs)

Hm, that may be the issue. Do you have any suggestions how to make the query without declaring a function?

Matěj Suchánek (talkcontribs)

Something like:

USE commonswiki_p;
SELECT page_title, COUNT(cl_to) AS panoramiocatcount
FROM page
JOIN categorylinks ON cl_from = page_id
WHERE page_namespace = 6
AND cl_to LIKE 'Photos\_from\_Panoramio\_ID\_%'
GROUP BY page_id
HAVING panoramiocatcount > 1;
1234qwer1234qwer4 (talkcontribs)

Thanks (it works)!