Last active
August 29, 2015 10:07
-
-
Save yalab/ebacaccf762f03061682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test=> SELECT sid, lid, COUNT(id) FROM attend GROUP BY sid, lid HAVING COUNT(id) > 1; | |
sid | lid | count | |
-----+---------+------- | |
336 | ACB0030 | 2 | |
325 | ABF0030 | 2 | |
(2 rows) | |
test=> SELECT id FROM attend WHERE sid = 336 AND lid = 'ACB0030'; | |
id | |
------- | |
60959 | |
60960 | |
(2 rows) | |
test=> SELECT id FROM attend WHERE sid = 325 AND lid = 'ABF0030'; | |
id | |
------- | |
75117 | |
(1 row) | |
test=> SELECT version(); | |
version | |
------------------------------------------------------------------------------------------------------ | |
PostgreSQL 9.3.6 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit | |
(1 row) | |
test=> SELECT sid, lid, COUNT(id) FROM attend GROUP BY sid, lid HAVING COUNT(id) > 1; | |
sid | lid | count | |
-----+---------+------- | |
336 | ACB0030 | 2 | |
325 | ABF0030 | 2 | |
(2 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment