{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/7992","repository_url":"https://api.github.com/repos/jOOQ/jOOQ","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/7992/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/7992/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/7992/events","html_url":"https://github.com/jOOQ/jOOQ/issues/7992","id":375083946,"node_id":"MDU6SXNzdWUzNzUwODM5NDY=","number":7992,"title":"Query PostgreSQL- Count colum return value when value equal 0","user":{"login":"Dangtrungphu","id":40323522,"node_id":"MDQ6VXNlcjQwMzIzNTIy","avatar_url":"https://avatars1.githubusercontent.com/u/40323522?v=4","gravatar_id":"","url":"https://api.github.com/users/Dangtrungphu","html_url":"https://github.com/Dangtrungphu","followers_url":"https://api.github.com/users/Dangtrungphu/followers","following_url":"https://api.github.com/users/Dangtrungphu/following{/other_user}","gists_url":"https://api.github.com/users/Dangtrungphu/gists{/gist_id}","starred_url":"https://api.github.com/users/Dangtrungphu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dangtrungphu/subscriptions","organizations_url":"https://api.github.com/users/Dangtrungphu/orgs","repos_url":"https://api.github.com/users/Dangtrungphu/repos","events_url":"https://api.github.com/users/Dangtrungphu/events{/privacy}","received_events_url":"https://api.github.com/users/Dangtrungphu/received_events","type":"User","site_admin":false},"labels":[{"id":9935131,"node_id":"MDU6TGFiZWw5OTM1MTMx","url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Functionality","name":"C: Functionality","color":"0000aa","default":false},{"id":1031730499,"node_id":"MDU6TGFiZWwxMDMxNzMwNDk5","url":"https://api.github.com/repos/jOOQ/jOOQ/labels/E:%20All%20Editions","name":"E: All Editions","color":"ffff00","default":false},{"id":9935166,"node_id":"MDU6TGFiZWw5OTM1MTY2","url":"https://api.github.com/repos/jOOQ/jOOQ/labels/P:%20Medium","name":"P: Medium","color":"ffaaaa","default":false},{"id":96192459,"node_id":"MDU6TGFiZWw5NjE5MjQ1OQ==","url":"https://api.github.com/repos/jOOQ/jOOQ/labels/T:%20Support%20request","name":"T: Support request","color":"cccccc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/100","html_url":"https://github.com/jOOQ/jOOQ/milestone/100","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/100/labels","id":644660,"node_id":"MDk6TWlsZXN0b25lNjQ0NjYw","number":100,"title":"Support Requests","description":"For all support requests by people who prefer to avoid the user group ;-)\r\nhttps://groups.google.com/forum/#!forum/jooq-user\r\n\r\n(which is generally more appropriate for support requests)","creator":{"login":"lukaseder","id":734593,"node_id":"MDQ6VXNlcjczNDU5Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/734593?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":130,"state":"open","created_at":"2014-04-30T08:23:55Z","updated_at":"2018-10-29T15:56:13Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-10-29T15:48:45Z","updated_at":"2018-10-29T15:56:13Z","closed_at":"2018-10-29T15:56:13Z","author_association":"NONE","body":"I have query 1:\r\nselect c.danh_muc_tin_text[1],count(c.danh_muc_tin_text) \r\nfrom com_tin_tuc c, thang t\r\nwhere EXTRACT(MONTH FROM c.time_create)= CAST(t.date AS INT)\r\ngroup by c.danh_muc_tin_text\r\n\r\nresult: [\r\n![3](https://user-images.githubusercontent.com/40323522/47661853-7060bf00-dbcc-11e8-80a8-8b1e5cfc9447.PNG)\r\n](url)\r\n\r\nwhen i change query 2:\r\n\r\nselect c.danh_muc_tin_text[1],count(c.danh_muc_tin_text) \r\nfrom com_tin_tuc c, thang t\r\nwhere EXTRACT(MONTH FROM c.time_create)= 9\r\ngroup by c.danh_muc_tin_text\r\n\r\n![4](https://user-images.githubusercontent.com/40323522/47661959-9e460380-dbcc-11e8-810f-07034fd928a8.PNG)\r\n\r\nHow to resutl have 4 row as query 1 with rows null  colum count equal 0. thanks"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/comments/433966148","html_url":"https://github.com/jOOQ/jOOQ/issues/7992#issuecomment-433966148","issue_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/7992","id":433966148,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzk2NjE0OA==","user":{"login":"lukaseder","id":734593,"node_id":"MDQ6VXNlcjczNDU5Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/734593?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2018-10-29T15:56:13Z","updated_at":"2018-10-29T15:56:13Z","author_association":"MEMBER","body":"You may want to use a left join instead of an implicit inner join:\r\n\r\n```sql\r\nselect c.danh_muc_tin_text[1],count(t.date)\r\nfrom com_tin_tuc c\r\nleft join thang t\r\non EXTRACT(MONTH FROM c.time_create)= CAST(t.date AS INT)\r\ngroup by c.danh_muc_tin_text\r\n```\r\n\r\nI hope this helps"}}
{"actor":{"display_login":"lukaseder"}}