select
(select first_name from random_names order by rand() limit 1) as random_first_name,
(select last_name from random_names order by rand() limit 1) as random_last_name;
though for tables of any size it is much faster if you programmatically determine the number of entries and pick a random offset for each column:
select
(select first_name from random_names order by first_name limit $first_name_offset,1) as random_first_name,
(select last_name from random_names order by last_name $last_name_offset,1) as random_last_name;
where the offsets are a random number from 0 to one less than the result of select count(*) from random_names. order by should be the primary key if the first/last name aren't indexed.
Followup question:
but how about list out result count equal to the number of values in original table? (just like shuffle the data in the table)
I'd do that like this:
create temporary table rand_last (id int(11) primary key auto_increment, last_name text) select last_name from random_names order by rand();
create temporary table rand_first (id int(11) primary key auto_increment, first_name text) select first_name from random_names order by rand();
select first_name, last_name from rand_first inner join rand_last using (id);
or possibly like this (assuming random_names has an 'id' primary key):
create temporary table rand_one (id int(11) primary key auto_increment, random_names_id int(11)) select id random_names_id from random_names order by rand();
create temporary table rand_two (id int(11) primary key auto_increment, random_names_id int(11)) select id random_names_id from random_names order by rand();
select rand_first.first_name, rand_last.last_name from rand_one inner join rand_two using (id) inner join random_names rand_first on rand_one.random_names_id=rand_first.id inner join random_names rand_last on rand_two.random_names_id=rand_last.id;