Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

TStanley's scratchpad

by TStanley (Canon)
on Jun 01, 2004 at 17:37 UTC ( [id://358303]=scratchpad: print w/replies, xml ) Need Help??

I have a table in a database with the following columns:
############################### # ID # First_Name # Last_Name # ###############################
I need to create a query to select both the First_Name and Last Name and present them as a single entity. What I have for my query so far (which did not work) is as follows:
SELECT (personnel.First_Name,personnel.Last_Name) AS Name FROM personnel;
The error I get from the database (MySQL 5) is:
ERROR 1241 (21000): Operand should contain 1 column(s)
Can someone with better SQL-fu than myself point me in the right direction?

###############################################
The Fisher-Yates shuffle done in Ruby:
def shuffle(array) a=array.length b=a-1 c=(0..b).to_a c.reverse! for d in c e=rand(d+1) next if e==d f=array[d];g=array[e] array[d]=g;array[e]=f end return array end
The Fisher-Yates shuffle done in Python:
import random list=[0,1,2,3,4,5,6,7,8,9] def shuffle(ary): a=len(ary) b=a-1 for d in range(b,0,-1): e=random.randint(0,d) if e == d: continue ary[d],ary[e]=ary[e],ary[d] return ary print shuffle(list)

You youngin' don't know how good you have it
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-10-03 11:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (42 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.