Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

SQL combinnig columns

Name: Anonymous 2007-07-30 3:47 ID:6xYTzvIk

Heyaa SQL-wizards. How do i combine two columns into one? Firstname and Lastname -columns need to be combined as Name -column. Databases previous user fucked up with tableformats and this table contains more than 900 names....

Name: Anonymous 2007-07-30 4:21 ID:E8dS2sDg

Firstname +' '+ Lastname

Name: Anonymous 2007-07-30 5:20 ID:SIo8e1Qp

It's pronounced ``Sequel''

Name: Anonymous 2007-07-30 6:27 ID:ke1hBn5l

Create the Name column and run:

MySQL: UPDATE YourTable SET Name = CONCAT( Firstname, ' ', Lastname )
Oracle: UPDATE YourTable SET Name = Firstname || ' ' || Lastname
MSSQL: UPDATE YourTable SET Name = Firstname + ' ' + Lastname

etc

Name: Anonymous 2007-07-30 6:32 ID:Heaven

>>4
But how do you pronounce ``SQL''?

Name: Anonymous 2007-07-30 6:37 ID:ke1hBn5l

>>5

I don't.

Name: Anonymous 2007-07-30 6:42 ID:Heaven

>>6
When you read ``SQL'', what does it sound like in your mind's voice?

Name: Anonymous 2007-07-30 6:46 ID:ke1hBn5l

>>7

SQL

Name: Anonymous 2007-07-30 6:46 ID:iTnTrsX7

SQL sounds like S Q L to me.

Name: Anonymous 2007-07-30 7:01 ID:Heaven

SQL sounds like /dev/random to me.

Name: Anonymous 2007-07-30 7:35 ID:Heaven

>>8-10
You are all wrong. It is pronounced ``Sequel''. I'm telling you this so in the future you won't appear foolish in front of fellow contempories. Anonymous delivers.

Name: Anonymous 2007-07-30 11:22 ID:LX0i+f5A

SQL, as a sequel to Sequel, is read S Q L.

Name: Anonymous 2007-07-30 11:38 ID:01aoB0kT

The bigger question is what SQL?

Name: Anonymous 2007-07-30 11:44 ID:ke1hBn5l

The bigger question is why SQL?

Name: Anonymous 2007-07-30 12:27 ID:LX0i+f5A

>>14
Becuase of SELECT. Saves so much work.

Name: Anonymous 2007-07-30 13:02 ID:odPBAjCN

>>4
Why no standard syntax?

Name: Anonymous 2007-07-30 13:05 ID:ke1hBn5l

>>16

SQL sucks.

Name: Anonymous 2007-07-30 16:56 ID:v6afeVeZ

Create your new table.

Insert into newtable (select firstname || lastname, blah, foo from old table)

drop old table and optionally rename new table

Name: Anonymous 2007-07-30 17:20 ID:zzh2pVxp

>>17
BAWWWWWW

Name: Anonymous 2007-07-30 17:35 ID:Ur0i9uHy

>>17 got his database stolen because of his shitty PHP code

Name: Anonymous 2007-07-30 17:37 ID:ke1hBn5l

>>19,20

No, not really.  It's because I'm using MySQL.

Name: Anonymous 2007-07-30 17:40 ID:Heaven

>>21
Aren't they pretty much the same thing?

Name: Anonymous 2007-07-30 17:41 ID:ke1hBn5l

>>22

They?

Name: Anonymous 2007-07-30 19:12 ID:I4tvDfva

>>23
MySQL and PHP.

They're both ubiquitous shit.

Name: Anonymous 2007-07-31 5:58 ID:BvnSWaYH

thanks guys

Name: Anonymous 2009-02-25 7:34


Also I believe you   mean I believe   you mean I   believe you mean   javascript is so   in the future   Stare at the   fuck are you   COULD WRITE IF.

Don't change these.
Name: Email:
Entire Thread Thread List