So, i'm working on VB.NET application but I'm having problem with one MSSQL query.
SELECT ISNULL(Sezona.NogSezona, '') FROM Trener LEFT JOIN Licenca ON Trener.BrTrenerskeIskaznice = Licenca.BrTrenerskeIskaznice LEFT JOIN Sezona ON Sezona.IDSezona = Licenca.IDSezona AND Licenca.IDSezona=3
This is the code I've been using 'til now, but it's not working as I wanted.
The thing is...I need to check if "Trener"(Coach, which has unique identification) have "Licenca"(license) with "IDSezone=3"(IDSeason). If Trener("Coach") have a license with "IDSezone=3"(IDSeason) print "NogSezona" string...if it doesn't have, print ''.
This code above, I thought it works fine, but if you have two license/records for one coach, one with "IDSezone=3" and one with "IDSezone=4", query will also return '' for that record with "IDSezone=4"...but I need a query that will look at this record like it doesn't exist...I need query that will always return let's say 429 rows(if 429 coaches are in database), and that will not look if one coach is having more license...
I hope you understand what I need, so i will appreciate if someone can help me.
* I'm from Croatia, so that's why i've been translating some words.