Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.