My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Databases

Databases Relational Databases and Data Mining- Database Models: Hierarchical, Network, Object, Post-Relational


Reply
 
LinkBack Thread Tools Display Modes
June 14th, 2011, 05:15 PM   #1
 
Joined: Jun 2011
Posts: 2
Array problem

Hello

I have a column for one row that has a string of numbers, something like “1,2,4,3,6,9,7,” These numbers are associated to rows. So number 1 is for row 1, 2 is for row 2, 4 is for row 4 and so on.

In each row, there’s a column for Firstname and a column for Lastname.

The problem is, I want to sort by the names and not the numbers. If I sort by the numbers and the first initial of the name for row 9 is A and the first initial for row 7 is B, then Beth will show up before Alex, right?

What I did was query all for each number to get the first and last names. Now I think I have to build another array that contains the full names as the value of each key then I can use the sort() function on the array, and walla! Sorted list of people’s names alphabetically!
cybercolt is offline  
 

My Computer Forum is free to register and we welcome everyone!

June 14th, 2011, 05:18 PM   #2
 
Joined: Jun 2011
Posts: 2
Re: Array problem

posted too fast.

How do I build a query that will populate an array with the Firstnames?
cybercolt is offline  
June 16th, 2011, 05:10 AM   #3
Site Founder
 
julien's Avatar
 
Joined: Dec 2007
Posts: 414
Re: Array problem

Which type of database are you using ? Are your queries in SQL ?
julien is offline  
Reply

  My Computer Forum > Computer Science Forum > Databases

Tags
array, problem



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Answer of an query in an array? HannoD Programming 3 September 1st, 2012 08:09 AM





Copyright © 2017 My Computer Forum Forum. All rights reserved.