multiple table data retrieval with function

This is a discussion on "multiple table data retrieval with function" within the Databases section. This forum, and the thread "multiple table data retrieval with function are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 26th, 2007, 13:01
Junior Member
Join Date: Feb 2007
Location: Crowborough UK
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
multiple table data retrieval with function

I want to retrieve similar data from two tables then add those two results together.

How would I do this:

Table one
Id1, bloggs, tuition fees (40)

Table two
Id1, bloggs, tuition fees (10)
Id2, bloggs, tuition fees (20)
Id2, bloggs, tuition fees (10)

Recordset:
Id1 bloggs tuition fees (40)
Id1, bloggs, tuition fees (10)
Id2, bloggs, tuition fees (20)
Id2, bloggs, tuition fees (10)

total should be tuition fees = 80

Here I want to search on 'bloggs' then add the tuition fees together. How do I not get duplicate data. I have tried different joins and unions but am getting confused by the whole busines.

SELECT dbo.payments.tuition, dbo.paymentAdd.tuition AS tuition2
FROM dbo.payments FULL OUTER JOIN
dbo.paymentAdd ON dbo.payments.student_id = dbo.paymentAdd.student_id

Many thanks for any help.
Reply With Quote

Reply

Tags
joins, transact sql, union

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how access data from table in php, azeemserver PHP Forum 2 Aug 30th, 2007 11:09
passing data accross multiple pages nate2099 PHP Forum 2 Jul 8th, 2007 15:26
writing a function to verify data inputted in textboxes jayaime JavaScript Forum 2 Jul 4th, 2006 03:29
ACCESS: one table one data,and only one! Monie Databases 1 Aug 2nd, 2004 09:00
ACCESS: one data in one table Monie Classic ASP 1 Aug 2nd, 2004 08:52


All times are GMT. The time now is 12:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43