On Sat, April 22, 2006 4:49 am, William Stokes wrote:
I have a column in DB that contains this kind of data,
A20,B16,B17C14,C15,D13,D12 etc.
I would like to print this data to a page and sort it ascending by the
letter an descending by the number. Can this be done? Like
A20
B17
B16
C15
Thanks for your input everyone!
The easiest way to do this was ansding this to the SELECT clause:
select col from DB order by substring(col, 1, 1) ASC, substring(col, 2) DESC
Seems to work fine.
-Will
Richard Lynch [EMAIL PROTECTED] kirjoitti
viestissä:[EMAIL PROTECTED]
On Sat, April 22,
On Apr 22, 2006, at 4:49 AM, William Stokes wrote:
Hello,
Any idea how to sort this?
I have a column in DB that contains this kind of data,
A20,B16,B17C14,C15,D13,D12 etc.
I would like to print this data to a page and sort it ascending by the
letter an descending by the number. Can this be
On Apr 24, 2006, at 9:06 AM, Philip Thompson wrote:
On Apr 22, 2006, at 4:49 AM, William Stokes wrote:
Hello,
Any idea how to sort this?
I have a column in DB that contains this kind of data,
A20,B16,B17C14,C15,D13,D12 etc.
I would like to print this data to a page and sort it ascending by
I have a column in DB that contains this kind of data,
A20,B16,B17C14,C15,D13,D12 etc.
I would like to print this data to a page and sort it ascending by the
letter an descending by the number. Can this be done? Like
A20
B17
B16
C15
C14
D13
D12
Depending on how many records you have
William Stokes wrote:
Hello,
Any idea how to sort this?
I have a column in DB that contains this kind of data,
A20,B16,B17C14,C15,D13,D12 etc.
I would like to print this data to a page and sort it ascending by the
letter an descending by the number. Can this be done?
PHP has the
See explode, http://www.php.net/explode
$var = 'A20,B16,B17C14,C15,D13,D12';
$array = explode(',',$var);
foreach ($array as $key = $value) {
echo $value .\n;
}
William Stokes wrote:
Hello,
Any idea how to sort this?
I have a column in DB that contains this kind of data,
hmm, should also see http://www.php.net/sort
Peter Hoskin wrote:
See explode, http://www.php.net/explode
$var = 'A20,B16,B17C14,C15,D13,D12';
$array = explode(',',$var);
foreach ($array as $key = $value) {
echo $value .\n;
}
William Stokes wrote:
Hello,
Any idea how to sort
At 02:49 AM 4/22/2006, William Stokes wrote:
I have a column in DB that contains this kind of data,
A20,B16,B17C14,C15,D13,D12 etc.
I would like to print this data to a page and sort it ascending by the
letter an descending by the number. Can this be done? Like
A20
B17
B16
C15
C14
D13
D12
At 03:43 AM 4/22/2006, I wrote:
Then just do a reverse sort on $aTemp and you get:
Z20
Y17
Y16
Then translate the letters back to their original values and you get:
A20
B17
C16
Oops, I made a typo: that final value should have been B16, not
10 matches
Mail list logo