Fix sql to get created client apps
Merge pull request #1171 from nlegoff/api-oauth-creds

[3.8] Fix sql to get created client apps