Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - SQL Joining tables
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL Joining tables

 Post Reply Post Reply
Author
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Topic: SQL Joining tables
    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

 

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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



Edited by Mart
Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Posted: 22 August 2004 at 5:28am

great!

now works

many thanks

mark

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.