DEV Community

AsadullohRuziev
AsadullohRuziev

Posted on

PostgreSQL unit-9

Image description

SELECT DISTINCT country FROM users;
Enter fullscreen mode Exit fullscreen mode

Image description

SELECT country FROM users GROUP BY country;
Enter fullscreen mode Exit fullscreen mode

Image description

SELECT country, COUNT(*) FROM users GROUP BY country;
Enter fullscreen mode Exit fullscreen mode

Image description

SELECT country, COUNT(*) FROM users GROUP BY country HAVING COUNT(*) > 2;
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)