On Sun, 18 Mar 2007 14:41:26 +0100, Huub wrote:
> Mirco Wahab wrote:
>> Huub wrote:
>>
>>> In my script I read 4 fields (2 numerical and 4 strings (i.e.
>>> 'char'-type)) from a MySQL database to print it. This works well, but
>>> I want to sort the array on one of the numerical fields before
>>> printing. I've looked through CPAN but get lost on looking for array.
>>> Can I store those fields in 1 array (how?) and sort the array or is
>>> there another way I should do this?
>>
>> What exactly do you do? (Working-)code snippets?
>>
>> Why isn't it in your case possible to retrieve sorted records from the
>> sql? Do you have accsess to the sql command?
>>
>> SELECT h.firstnumber, h.secondnumber, h.firststring, h.secondstring
>> FROM huubtable as h
>> ORDER BY h.secondnumber
>>
>>
> Didn't think of this way.
>
If the table is large and you create an index on secondnumber, this is
also very fast, at the expense of slower insertion times.
M4
|