swag

L'autista
Administrator
Sep 23, 2003
83,441
What am I doing right now?

I set a record of not having a bowel movement in 10 days...that coupled with the permanent diarrhea I decided to sit on the bowl and throw a Juventus flag in the bowl along with an over rated Del Piero poster and took what is the most massive dump in the history of dumps...


Burp
Nick! You poor-man's Christian-Vieri-looking anal hairball! How you been?

@Martin

SELECT CustomerName, Address+', '+City+', '+PostalCode+', '+Country AS Address
FROM Customers;

I understand what this does. What I don't understand is why the bold parts. I mean, why that order (starting +' and ending '+)? I don't think I've seen the explanation for it before.
Bobby Tables :touched:
 

Dostoevsky

Tzu
Administrator
May 27, 2007
88,442
So this would be on a table that looks like this:

Code:
--------------------------------------------------------
| CustomerName | Address | City | PostalCode | Country |
--------------------------------------------------------
| Bob          | at home | Roma | 234234     | Italy   |
| Frank        | at work | Roma | 45644      | France  |
--------------------------------------------------------
The result of that select would be:

Code:
--------------------------------------------------------
| CustomerName | Address                               |
--------------------------------------------------------
| Bob          | at home, Roma, 234234, Italy          |
| Frank        | at work, Roma, 45644, France          |
--------------------------------------------------------
So from a table with 5 columns you're returning two columns of values, the first being CustomerName just as its stored, the second being a combination of the other 4.

Is that clear?
It is clear. That does make sense.

I just don't know why is is written like this +'. This
 

Attachments

Martin

Senior Member
Dec 31, 2000
56,913
It is clear. That does make sense.

I just don't know why is is written like this +'. This
I don't know how many concepts you've learned already.

In programming there is a basic concept called a string. It means a sequence of characters.

"a" is a character
"abc" is a string (more than one character)

In the SELECT you showed there are several strings being concatenated (ie. glued together) using the + sign (which means "joing two strings into one string").

So:

"a" + "b" => "ab"

- - - Updated - - -

I'll tell you later :D
 

Dostoevsky

Tzu
Administrator
May 27, 2007
88,442
I don't know how many concepts you've learned already.

In programming there is a basic concept called a string. It means a sequence of characters.

"a" is a character
"abc" is a string (more than one character)

In the SELECT you showed there are several strings being concatenated (ie. glued together) using the + sign (which means "joing two strings into one string").

So:

"a" + "b" => "ab"
This post made me feel like a retard. :D

Thanks.

Nick! You poor-man's Christian-Vieri-looking anal hairball! How you been?


Bobby Tables :touched:
Hey, I'm just trying to expand the universe of not-knowing. :p
 
OP
ßöмßäяðîëя
Apr 12, 2004
77,165
  • Thread Starter
  • Thread Starter #328,535
    What am I doing right now?

    I set a record of not having a bowel movement in 10 days...that coupled with the permanent diarrhea I decided to sit on the bowl and throw a Juventus flag in the bowl along with an over rated Del Piero poster and took what is the most massive dump in the history of dumps...


    Burp
    Nick, you dirty bitch.

    - - - Updated - - -

    How's Apple treating you, Michael?
    It's going well, brah. Don't call me by my slave name.
     

    Lapa

    FLY, EAGLES FLY
    Sep 29, 2008
    19,949
    Saying coffee doesn't wake you up is bullshit though. It contains caffeine. Caffeine does that. Beer makes you drunk, because it contains alcohol. I mean, let's not start saying things that don't make any sense, please :).
    Beer makes you happy. Not sure if being "drunk" is the same as being "happy". :p

    It all depends on your tolerance. Someone who drinks a lot of coffee probably won't see the same effect as someone who only has it occasionally, same with beer or other alcohol.
    This is true.. if my gf drinks a cup of coffee like an hour before going to sleep, she will stay up all night (she prefers tea which is meh).
     

    Users Who Are Viewing This Thread (Users: 2, Guests: 623)