Skip to content

Query Tips & Tricks

Join two tables

  • The p calls from the processes table
  • The u calls from the users table
  • u.uid=p.uid portion of the command gives the part of the schema that both have in common allowing the join
  • Calls from two separate processes and users using the uid to match
SELECT p.parent, p.path,, p.cwd, u.uid, u.username
FROM processes p
JOIN users u ON u.uid=p.uid;


SELECT address, mac, mac_count
    (SELECT address, mac, COUNT(mac) AS mac_count FROM arp_cache GROUP BY mac)
  WHERE mac_count > 1;