I have an injection table called StudentSchool
that contains :
StudentSchoolID StudentId SchoolID
1 233 22
But now I want to make the table with composite primary key like this:
StudentId SchoolID
233 22
In the first case I select using
select * from StudentSchool
where (StudentId = 233) and (SchoolID = 22)
but in the second case how to do that with it as it is a primary key
I'm not sure if I understand the question correctly.
If you want the student with StudentId 233 and SchoolId 22, then it's the same query like for the first case.
Maybe I am missing something but your query would be the same
select * from YourNewTable where (StudentId =233)and (ScoohlID=22)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With