Print Page | Close Window

SQL Joining tables

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11591
Printed Date: 30 March 2026 at 4:18am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Joining tables
Posted By: ainsworth14
Subject: SQL Joining tables
Date Posted: 21 August 2004 at 2:46pm

Hi all, another question for you, any help appreciated!

I have 2 tables: record_overview (which is main data table) and TOC (table of contents)

in my catID field in record_overview i have 4 digit number that distinguish its category. In my TOC table i have the category description field ie

9999 - pop music

8898 - classical

etc

i want to show my records on page with the description field of my TOC table next to it. I know i have to join tables in the SQL query but i am having no luck. At the moment all i am getting is the 4 digit number instead of the full category description.

this problem has come to light from a results.asp page where i have no categoey id string to pass on ie my home page to category.asp passed category id in its url.

hope it makes sense and someone can help
thanks
mark

 




Replies:
Posted By: Mart
Date Posted: 21 August 2004 at 3:06pm

Something like

SELECT * FROM record_overview, TOC Where record_overview.Category = TOC.Category

EDIT: Change the * to a list of fields otherwise you will get an ambiguous column error



Posted By: ainsworth14
Date Posted: 22 August 2004 at 5:28am

great!

now works

many thanks

mark




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net