Page 1 of 1

Using initial query to determine column array info?

Posted: Tue Sep 04, 2007 6:43 pm
by robster
Hi all,

I have a table with data similar to this for example:

Code: Select all

1
1
2
1
2
2
3
4
6
5
5
1
and I'd like to create an array with the following info:

Code: Select all

1, 2, 3, 4, 5, 6
(order not essential)

The question then, is: Using MySQL 4.x, Is there a way to have the initial query return the results I need, without having to parse through the table and manually push the data into an array?

My SQL is still quite beginner level.

Any advice would be really appreciated! :)

Rob

Posted: Tue Sep 04, 2007 7:22 pm
by Christopher
Look into the DISTINCT keyword in SQL.

Posted: Tue Sep 04, 2007 7:27 pm
by robster
Thank you so much, looks like it's better than group by for some things:
http://www.liamdelahunty.com/tips/mysql ... oup_by.php

Muchly appreciated!