JimTrail Posted September 22, 2016 Share Posted September 22, 2016 Hello W3Schools Forum! This website keeps getting better. Used to I hardly ever visited it. Now it's one of my primary go-to destination points for programming information. I really do appreciate the information. I have got a question about the DISTINCT. http://www.w3schools.com/sql/sql_distinct.asp I cannot get the two column format to work. SELECT DISTINCT column_name, column_name // Can't get this one to work. FROM table_name; I can get the query to work with one column. SELECT DISTINCT column_name // It works fine using just one column. FROM table_name; It's worth noting. I have got a GoDaddy shared hosting. GoDaddy technical support says the hosting is on one of the older machines. The highest version of PHP is PHP 5.4 on the server. It's probably got an older version of MySQL, also. That could be the problem. I have been with GoDaddy since 2003. I am starting to look around for other hosting providers. Link to comment Share on other sites More sharing options...
Ingolme Posted September 22, 2016 Share Posted September 22, 2016 When you use DISTINCT on multiple columns, the only thing that is distinct is the combination of the column's values. If the values of each column can be "A" and "B", the query for two columns could only return a maximum of four results: AA, AB, BA and BB 1 Link to comment Share on other sites More sharing options...
JimTrail Posted September 24, 2016 Author Share Posted September 24, 2016 When you use DISTINCT on multiple columns, the only thing that is distinct is the combination of the column's values. If the values of each column can be "A" and "B", the query for two columns could only return a maximum of four results: AA, AB, BA and BB Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now