{"action":"closed","issue":{"url":"https://api.github.com/repos/GeoForum/veiledning02/issues/1","labels_url":"https://api.github.com/repos/GeoForum/veiledning02/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/GeoForum/veiledning02/issues/1/comments","events_url":"https://api.github.com/repos/GeoForum/veiledning02/issues/1/events","html_url":"https://github.com/GeoForum/veiledning02/issues/1","id":78211644,"number":1,"title":"Problemer med join","user":{"login":"ellvtr","id":12038749,"avatar_url":"https://avatars.githubusercontent.com/u/12038749?v=3","gravatar_id":"","url":"https://api.github.com/users/ellvtr","html_url":"https://github.com/ellvtr","followers_url":"https://api.github.com/users/ellvtr/followers","following_url":"https://api.github.com/users/ellvtr/following{/other_user}","gists_url":"https://api.github.com/users/ellvtr/gists{/gist_id}","starred_url":"https://api.github.com/users/ellvtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellvtr/subscriptions","organizations_url":"https://api.github.com/users/ellvtr/orgs","repos_url":"https://api.github.com/users/ellvtr/repos","events_url":"https://api.github.com/users/ellvtr/events{/privacy}","received_events_url":"https://api.github.com/users/ellvtr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GeoForum/veiledning02/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":{"login":"ellvtr","id":12038749,"avatar_url":"https://avatars.githubusercontent.com/u/12038749?v=3","gravatar_id":"","url":"https://api.github.com/users/ellvtr","html_url":"https://github.com/ellvtr","followers_url":"https://api.github.com/users/ellvtr/followers","following_url":"https://api.github.com/users/ellvtr/following{/other_user}","gists_url":"https://api.github.com/users/ellvtr/gists{/gist_id}","starred_url":"https://api.github.com/users/ellvtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellvtr/subscriptions","organizations_url":"https://api.github.com/users/ellvtr/orgs","repos_url":"https://api.github.com/users/ellvtr/repos","events_url":"https://api.github.com/users/ellvtr/events{/privacy}","received_events_url":"https://api.github.com/users/ellvtr/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-19T19:01:38Z","updated_at":"2015-05-22T10:19:33Z","closed_at":"2015-05-22T10:19:33Z","body":"\r\n![komm1](https://cloud.githubusercontent.com/assets/12038749/7711360/4c3c7094-fe6a-11e4-946e-d383f06b8105.png)\r\n![komm2](https://cloud.githubusercontent.com/assets/12038749/7711364/51fc60c0-fe6a-11e4-9a21-69094ec9b904.png)\r\n\r\nHar lastet ned arbeidsledighet og hjertekar-dødelighet, se /data/ (opprinnelig xls, ligger også i ods og csv format).\r\n\r\nHar vasket data og lagt dem inn i lokal postgis-database, se data01.sql.\r\nHar også lagt inn kommuner fra kartverket i postgis - først lagret som shp, siden importert via shp2pgsql og psql - se /data/kommuner.txt.\r\n\r\nTabellene skal joines men har ikke unik nøkkel som fx kommune-nummer, de har kun kommunenavn å joine på.\r\n\r\nSQL er ikke min sterkeste side, er litt tvil om hvordan dette gjøres. I /data/data02.sql har jeg prøvd litt forskjellig bla med LIKE. Klarer å joine 416 av 434 rekker med SQL.\r\n\r\nI QGIS klarer jeg også å joine 416 av 434 rekker - se screenshot av join.\r\nAndre screenshot viser de kommuner med lilla farge som ikke har data etter join.\r\n\r\n```sql\r\nselect \r\n\ta.kommnavn ,\r\n\tk.navn\r\nfrom \r\n\ttest01.arbeidsledighet as a, \r\n\ttest01.kommuner as k\r\nwhere \r\n\t--a.kommnavn like k.navn -- 416 rows\r\n\tk.navn like a.kommnavn -- 416 rows \r\n\t--k.navn like a.kommnavn || '%' -- 445 rows due to ie Sel and Selje matches\r\n```"}}