0

I have two tables as below

table 1
ProductID---Int
Descritption---Text

table 2
Id
FK_ProductID--Int
Category

but on the FK_ProductID I dont want my table not to display a number but the description from TBLA.

2
Contributors
7
Replies
8
Views
8 Years
Discussion Span
Last Post by dickersonka
0
SELECT t1.Description, t2.Category
FROM table2 t2
inner join table1 t1
on t1.ProductId = t2.ProductId

thanks for your respond

I am not trying to retrieve data from the table.but want this to show in my real table, Is it possible?

Regards
Sally.

0

i don't get what you are meaning, you just said you wanted to select from the table without displaying the id

what is a real table?

0

i don't get what you are meaning, you just said you wanted to select from the table without displaying the id

what is a real table?

sorry about misunderstanding

I have two tables:
TblA
ProductID
Description

TblB
ID
Fk_ProductID
Order

for the data in real tables , I want to know if is it possible for the field Fk_ProductID to show description not the productID.

0

as in you want the fk to be linked to the description?
the query i gave you return the description and category
i'm still not sure what you are needing

0

hi

when opening tblB , the field FK_ProductID should be filled in with the description not the ID from tblA.

I dont want to see the ID but the description corresponding to that ID on the FK field

is it possible?

0

that is the point of a relational database, to have entities (such as products) grouped with themselves, and their id field be used when they are referenced, that is why you have to build the query to "pull" the description from the id like i gave you

SELECT t1.Description, t2.Category
FROM table2 t2
inner join table1 t1
on t1.ProductId = t2.ProductId
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.