• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

2 tables 1 datasource

Explorer ,
May 16, 2008 May 16, 2008

Copy link to clipboard

Copied

Hi,

I have a single datasource with two tables. In table 1 I have lots of data with a single column (Notes) containing a value (1-4) which relates to a note. In table 2 I have the corresponding note number and description:

TBL1
Column = Notes
1

TBL2
Column = Note
1
Column = Description
Blah blah bla

I would like to be able to display the correct note description relative to the note number displayed. i.e. the user makes a selection, say 10 results ensue, against two of these notes 1 and 2 appear.

At the bottom of the results page I would like to display notes 1 and 2 with the relevant description.

Hope this makes sense, TIA.

Trevor
TOPICS
Advanced techniques

Views

285

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 16, 2008 May 16, 2008

Copy link to clipboard

Copied

If I understand your requirements correctly I recommend you research "JOIN" and "INNER JOIN" in your database server's documentation.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 16, 2008 May 16, 2008

Copy link to clipboard

Copied

LATEST
Your query would resemble something like one of these:

SELECT t1.yourtable1columns, t2.Description
FROM tbl1 t1
INNER JOIN tbl2 t2 ON t1.notes = t2.note
WHERE whateverelse

or

SELECT t1.yourtable1columns, t2.Description
FROM tbl1 t1, tbl2 t2
WHERE t1.notes = t2.note
AND whateverelse

Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation