MySQL Forums
Forum List  »  Stored Procedures

Re: SP syntax error??
Posted by: Rick James
Date: March 30, 2014 11:04PM

Get rid of the cursor.

In the real SELECT, add a JOIN that contains the first SELECT:
JOIN ( SELECT last_name, first_name, users.id
FROM users JOIN documents ON (users.id = documents.user_id)
JOIN licenses ON (licenses.user_id = users.id)
WHERE multi_user_license_id IS NULL
GROUP BY last_name, first_name
HAVING count(documents.title) > 60 ) x ON ...

Options: ReplyQuote


Subject
Views
Written By
Posted
2497
March 27, 2014 04:08PM
1210
March 27, 2014 08:26PM
1159
March 28, 2014 10:47AM
1150
March 28, 2014 12:04PM
1208
April 04, 2014 01:49PM
1164
March 28, 2014 01:09AM
1272
March 28, 2014 10:41AM
1140
March 28, 2014 12:11PM
Re: SP syntax error??
1143
March 30, 2014 11:04PM
1070
April 04, 2014 01:02PM
1085
April 04, 2014 01:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.