The * was just because I am lazy, the point of my question was related to the original post, where he was using "Group by" and "Order by".
My question was really "Why not just use order by"? So (with my original question) I should have written: SELECT firstname, lastname from HowToExample ORDER BY Ranking; I've been designing, writing, and maintaining software for over 20 years. I understand the potential problem/confusion with using an * in a program, a change to the structure of the row, adding a column, deleting a column, and so on would break all programs using a * on that specific table. Now I've learned that using a * in a email can also cause confusion about what the original question. :-) Cheers, Michael. > Because * could be anything, and you could change the structure of the > table > after making the program, and the order of the columns might change, and > then the program might not work. > > But if you'll use > > select first_name, last_name, address, etc from table_name; > > then even if you will change the order of the columns or insert new > columns > between the existing columns, your program will surely work. > > Of course, if you don't get the columns by their position in your program, > but by their name, then your program would work in any case. > > For example, if in perl you would do: > > while (my $row = $sth->fetchrow_hashref) { > print $row->{first_name}; > print $row->{last_name}; > } > > then you could use select * from table_name without any problem. > > Octavian > > ----- Original Message ----- > From: <mich...@j3ksolutions.com> > To: "MySQL General List" <mysql@lists.mysql.com> > Sent: Saturday, February 14, 2009 3:21 AM > Subject: Re: Simple data, simple query giving me a brain-ache > > >> I'm a SQL novice, and I'v been looking at this, and I know I shouldn't, >> but I was 'Thinking'; >> >> Why wouldn't you do the following? >> >> SELECT * from HowToExample ORDER BY Ranking; >> >> Just curious, >> Michael. >> >> -- >> MySQL General Mailing List >> For list archives: http://lists.mysql.com/mysql >> To unsubscribe: http://lists.mysql.com/mysql?unsub=orasn...@gmail.com >> > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org