{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8407","repository_url":"https://api.github.com/repos/orientechnologies/orientdb","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8407/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8407/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8407/events","html_url":"https://github.com/orientechnologies/orientdb/issues/8407","id":342010430,"node_id":"MDU6SXNzdWUzNDIwMTA0MzA=","number":8407,"title":"OrientDB SQL DISTINCT function","user":{"login":"diegomtassis","id":5831026,"node_id":"MDQ6VXNlcjU4MzEwMjY=","avatar_url":"https://avatars1.githubusercontent.com/u/5831026?v=4","gravatar_id":"","url":"https://api.github.com/users/diegomtassis","html_url":"https://github.com/diegomtassis","followers_url":"https://api.github.com/users/diegomtassis/followers","following_url":"https://api.github.com/users/diegomtassis/following{/other_user}","gists_url":"https://api.github.com/users/diegomtassis/gists{/gist_id}","starred_url":"https://api.github.com/users/diegomtassis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegomtassis/subscriptions","organizations_url":"https://api.github.com/users/diegomtassis/orgs","repos_url":"https://api.github.com/users/diegomtassis/repos","events_url":"https://api.github.com/users/diegomtassis/events{/privacy}","received_events_url":"https://api.github.com/users/diegomtassis/received_events","type":"User","site_admin":false},"labels":[{"id":21666882,"node_id":"MDU6TGFiZWwyMTY2Njg4Mg==","url":"https://api.github.com/repos/orientechnologies/orientdb/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"luigidellaquila","id":459289,"node_id":"MDQ6VXNlcjQ1OTI4OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/459289?v=4","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false},"assignees":[{"login":"luigidellaquila","id":459289,"node_id":"MDQ6VXNlcjQ1OTI4OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/459289?v=4","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-07-17T17:18:31Z","updated_at":"2018-07-18T07:04:12Z","closed_at":"2018-07-18T06:14:31Z","author_association":"CONTRIBUTOR","body":"### OrientDB Version: <version here>  \r\n2.2.36\r\n\r\nThe [documentation says here](https://orientdb.com/docs/2.2.x/SQL.html#distinct):\r\n\r\n> In SQL, DISTINCT is a keyword but in OrientDB it is a function, so if your query is:\r\n> `SELECT DISTINCT name FROM City`\r\n> \r\n> In OrientDB you would write:\r\n> `SELECT DISTINCT(name) FROM City`\r\n> \r\n\r\nBut in SQL, let's take a look at the [grammar of ANSI-SQL-99](https://github.com/ronsavage/SQL/blob/master/sql-99.bnf) as example, the set quantifier applies to all the fields.\r\n```\r\n<query specification> ::= SELECT [ <set quantifier> ] <select list> <table expression>\r\n<set quantifier> ::= DISTINCT | ALL\r\n```\r\n\r\nSo in ANSI-SQL-99, `SELECT DISTINCT foo, bar FROM table` is a valid query.\r\n\r\nWhat is the equivalent in OrientDB SQL?"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/405831129","html_url":"https://github.com/orientechnologies/orientdb/issues/8407#issuecomment-405831129","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8407","id":405831129,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTgzMTEyOQ==","user":{"login":"diegomtassis","id":5831026,"node_id":"MDQ6VXNlcjU4MzEwMjY=","avatar_url":"https://avatars1.githubusercontent.com/u/5831026?v=4","gravatar_id":"","url":"https://api.github.com/users/diegomtassis","html_url":"https://github.com/diegomtassis","followers_url":"https://api.github.com/users/diegomtassis/followers","following_url":"https://api.github.com/users/diegomtassis/following{/other_user}","gists_url":"https://api.github.com/users/diegomtassis/gists{/gist_id}","starred_url":"https://api.github.com/users/diegomtassis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegomtassis/subscriptions","organizations_url":"https://api.github.com/users/diegomtassis/orgs","repos_url":"https://api.github.com/users/diegomtassis/repos","events_url":"https://api.github.com/users/diegomtassis/events{/privacy}","received_events_url":"https://api.github.com/users/diegomtassis/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T07:04:12Z","updated_at":"2018-07-18T07:04:12Z","author_association":"CONTRIBUTOR","body":"Thanks @luigidellaquila "}}
{"actor":{"display_login":"diegomtassis"}}