What is Wrong in this code

Select * from Studentinfo
Inner Join Admission
On Studentinfo.Studentid= admission.studentid
where Studentid= '1'

Please Help as soon as Possible

Recommended Answers

All 5 Replies

Member Avatar for stbuchok

What is the error you are getting? My guess is for the Where clause you need StudentInof.Studentid = '1', also is Studentid an int? If so change it to StudentInof.Studentid = 1

Some strange sql query. Why would you compare those two table, when you only want to get all the data from Studentinfo table. Admission table has nothing to do here, since you do get any data from Admission table.
So I recommend you to change the query to:

Select * from Studentinfo
where Studentid= '1'
Member Avatar for stbuchok

Mitja Bonca, how do you know that the Admission table has nothing to do with the students? Students get admitted, if a student is in the StudentInfo table but is not admitted and you only want the info for students that are admitted, this makes sense.

Yes it does. It really does. Sorry.
In this case, your approach is correct.
Even if StudentId field is only in Studentinfo table, it should work.
But if he has the same field name in more then one table, then it will not work.

As far as I can see he has the same name in Admission table too, so your code will do it!

Oh Really thanks to stbuchok
It Solved my Problem and i got result with Studentinfo.studentid

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.