Thread: table query??
View Single Post
  #1  
Old 05-26-2007, 02:47 AM
rifell rifell is offline
Junior Member
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
rifell is on a distinguished road
Default table query??

Hi people,
i have 2 tables:

TABLE: detail
-------------------
id varchar(10)
varname varchar(20) i.e. lastname,firstname
content text i.e. Wallace,Andrew

and at least:

TABLE: main
--------------------
id varchar(10)
attribs varchar(250)
--------------------
Now i wanna make a fast access to the tables. The result should be

id,lastname,firstname
123,Wallace,Andrew

Is it possible to get this result with 1 query?

Such as, select content as name from detail,main WHERE detail.id=main.id ?
But the field 'content' is named 'name' and not the value of 'name'.
Is it possible to use the value?
Thanks. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - table query??
Thread: table query??
View Single Post
  #1  
Old 05-26-2007, 02:47 AM
rifell rifell is offline
Junior Member
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
rifell is on a distinguished road
Default table query??

Hi people,
i have 2 tables:

TABLE: detail
-------------------
id varchar(10)
varname varchar(20) i.e. lastname,firstname
content text i.e. Wallace,Andrew

and at least:

TABLE: main
--------------------
id varchar(10)
attribs varchar(250)
--------------------
Now i wanna make a fast access to the tables. The result should be

id,lastname,firstname
123,Wallace,Andrew

Is it possible to get this result with 1 query?

Such as, select content as name from detail,main WHERE detail.id=main.id ?
But the field 'content' is named 'name' and not the value of 'name'.
Is it possible to use the value?
Thanks. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote