Skip to content

Instantly share code, notes, and snippets.

@DILL44
Created November 29, 2014 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DILL44/a96b4c66f505ad0eb6d8 to your computer and use it in GitHub Desktop.
Save DILL44/a96b4c66f505ad0eb6d8 to your computer and use it in GitHub Desktop.
sql requests for show relation between nodes (content) and users
comming bash
SELECT `users`.`name` , `users`.`mail` , `role`.`name`
FROM `users` , `role` , `users_roles`
WHERE `users`.`uid` = `users_roles`.`uid`
AND `role`.`rid` = `users_roles`.`rid`
LIMIT 0 , 30
SELECT `node`.`nid` , `node`.`type` , `node`.`title` , `node`.`status` , `users`.`uid` , `users`.`name` , `users`.`mail`
FROM `node` , `users`
WHERE `users`.`uid` = `node`.`uid`
LIMIT 0 , 30
SELECT `users`.`uid` , `users`.`name` , `users`.`mail`
FROM `node` , `users`
WHERE `users`.`uid` = `node`.`uid`
GROUP BY `users`.`uid`
LIMIT 0 , 30
SELECT `comment`.`nid` , `comment`.`subject` , `comment`.`status` , `users`.`uid` , `users`.`name` , `users`.`mail`
FROM `node` , `users`
WHERE `users`.`uid` = `node`.`uid`
LIMIT 0 , 30
SELECT `users`.`uid` , `users`.`name` , `users`.`mail`
FROM `comment` , `users`
WHERE `users`.`uid` = `comment`.`uid`
GROUP BY `users`.`uid`
LIMIT 0 , 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment