General Development

Combining Two table values to show in the datagrid – DeathFox

DeathFox
Member

Posts: 57
From:
Registered: 04-25-2006
My value in FirstName table is "Albert" and value in LastName table is "Cruz". I have a datagrid on which I wanna show just one column that has "Albert Cruz".

I had the sql statement before which does this but I just reformated my PC Plz help

Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
This tutorial page shows first how to do that, before going in to join's usage:

http://www.w3schools.com/sql/sql_join.asp

So it's basically :


SELECT Table1.firstname, Table2.lastname FROM Table1, Table2 WHERE Table1.firstname='Albert'

I hope that helps.


------------------
Psa 32:5 I acknowledged my sin unto thee, and mine iniquity have I not hid. I said, I will confess my transgressions unto the LORD; and thou forgavest the iniquity of my sin. Selah.

[VoHW] (Help needed) [Blog] (Contact) - Truedisciple (mp3)

[This message has been edited by jari (edited September 28, 2007).]

samw3

Member

Posts: 542
From: Toccoa, GA, USA
Registered: 08-15-2006
If you are using mysql, maybe try this...


SELECT CONCAT(Table1.firstname, ' ', Table2.lastname) AS fullname FROM Table1, Table2

the concatenated name (i.e. combined together) will be returned as "fullname".

God Bless!

------------------
Sam Washburn

Check out my CCN SpeedGame 2 Blog

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
nevermind

[This message has been edited by mastallama (edited September 29, 2007).]