473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Retrieve data from Three table using JOIN

create table stuinfo(roll int,name varchar(10))
insert into stuinfo values(1,'sonia')
insert into stuinfo values(2,'usha')
select * from stuinfo

create table marks(roll int,grade varchar)
insert into marks values(1,'A')
insert into marks values(2,'B')
select * from marks

create table fees(roll int,totfess int,remfess int)
insert into fees values(1,5000,1000)
insert into fees values(3,5000,0)
select * from fees

select stuinfo.roll,name,grade,tofees
from stuinfo
JOIN marks On stuinfo.roll=marks.roll
JOIN fees on marks.roll=fees.roll

error-Invalid Column totfees
Mar 30 '08 #1
4 2322
ck9663
2,878 Expert 2GB
create table stuinfo(roll int,name varchar(10))
insert into stuinfo values(1,'sonia')
insert into stuinfo values(2,'usha')
select * from stuinfo

create table marks(roll int,grade varchar)
insert into marks values(1,'A')
insert into marks values(2,'B')
select * from marks

create table fees(roll int,totfess int,remfess int)
insert into fees values(1,5000,1000)
insert into fees values(3,5000,0)
select * from fees

select stuinfo.roll,name,grade,tofees
from stuinfo
JOIN marks On stuinfo.roll=marks.roll
JOIN fees on marks.roll=fees.roll

error-Invalid Column totfees

Your create table says

create table fees(roll int,totfess int,remfess int)

Your query says
select stuinfo.roll,name,grade,tofees

-- CK
Mar 30 '08 #2
Thx Yaar. Sory, Its by mistake tofees.
Mar 30 '08 #3
ck9663
2,878 Expert 2GB
So do you still have that error?

-- CK
Mar 31 '08 #4
No yaar, its working
Mar 31 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Daniel Tonks | last post by:
First, please excuse the fact that I'm a complete MySQL newbie. My site used forum software that I wrote myself (in Perl) which, up until now, has used flat files. This worked fine, however...
4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
9
by: Vorpal | last post by:
Here is a small sample of data from a table of about 500 rows (Using MSSqlserver 2000) EntryTime Speed Gross Net ------------------ ----- ----- 21:09:13.310 0 0 0 21:09:19.370 9000 ...
4
by: CSDunn | last post by:
Hello, I have a combo box (Combo7) that needs to call a function during the After Update event of the combo box. The function resides in an Access 2000 ADP Module called MMAnswerData_code. The...
12
by: jaYPee | last post by:
I have currently using a dataset to access my data from sql server 2000. The dataset contains 3 tables that is related to each other. parent/child/grandchild relationship. My problem is it's very...
2
by: jaYPee | last post by:
I have no problem setting the selectcommand in sqldataadapter to fetch record from sqlserver w/ where clause in parent table. however, my problem is on how can i fetch the child table which is...
2
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
9
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.