change line "FROM Afdeling x, Bestuursafdeling y"
to "FROM Afdeling as x, Bestuursafdeling as y"
EDIT: also looking at your first line, I am not sure if you will get desired result with your count(y.lnt). It looks to be used a bit strange (eng column/table names would actually increase readability, now I am not sure what you are trying to do)
well, depends on what sql engine you are running, I am using 5.0.7, tried your query and it actually runs without any problem.
But, there can be one more thing, first try to run query without count, if it runs ok, you are probably missing GROUP BY statement, if it wont, well, there is smth strange then :D
I am running my own MySQL server together with Apache server, if you want easy installation and setup, download XAMPP, its really easy.
btw, error code -104 is smth about syntax error, to be more specific invalid character appears there where some reserved word is expected.
try this, if this wont work, I guess there is smth wrong with your database script interpreter.
there is one more thing you can try, and I guess it should be ok even for year 1999 :P
first, you have to check whether your table are really starting with uppercase (in my database, they got created with lowercase eventhought I used very same sql commands you provided here, but my db seems to be case insensitive, so it doesnt rly matter)
try this, there is no aliasing and there is fully written join statement.
FROM Afdeling x, Bestuursafdeling y
WHERE x.adcode = y.adcode
is shorthand for
FROM Afdeling x INNER JOIN Bestuursafdeling y
ON x.adcode = y.adcode
so that shouldnt really matter. But as he said he is using db from 1999, I wouldnt be surprised its bithing about it, SQL standarts back then had to be kinda different from todays.
on contrary, you should actually be glad that you know the mechanics of join and what actually stands behind that shorthand code. And also sometimes you need LEFT/RIGHT/OUTER JOINs too, and there is no short form for those (i guess).
to "FROM Afdeling as x, Bestuursafdeling as y"
EDIT: also looking at your first line, I am not sure if you will get desired result with your count(y.lnt). It looks to be used a bit strange (eng column/table names would actually increase readability, now I am not sure what you are trying to do)
users as in lnr
department as in adcode(department code) and naamsport(department name)
edit:
when I tried your version
But, there can be one more thing, first try to run query without count, if it runs ok, you are probably missing GROUP BY statement, if it wont, well, there is smth strange then :D
anyway, im a bit embarrassed to tell you but im using Interbase from the year 1999 or smth
which program are you running?
works but when I add x.adcode and x.naamsport it doesnt
btw, error code -104 is smth about syntax error, to be more specific invalid character appears there where some reserved word is expected.
try this, if this wont work, I guess there is smth wrong with your database script interpreter.
It gives errors for the ' tokens, also for "as"
Thanks man, you have been a great help.
Ill just hand these in and tell him this system is too old.
first, you have to check whether your table are really starting with uppercase (in my database, they got created with lowercase eventhought I used very same sql commands you provided here, but my db seems to be case insensitive, so it doesnt rly matter)
try this, there is no aliasing and there is fully written join statement.
it still gives me: invalid column reference
Thx for your efforts man but I guess my sql program is just outdated
im gonna send u a pm, could u check that one out for me too?
otherwise theres something wrong with ur collumns as the error suggest, try looking at capitals etc as its often case sensitive
WHERE x.adcode = y.adcode
is shorthand for
FROM Afdeling x INNER JOIN Bestuursafdeling y
ON x.adcode = y.adcode
so that shouldnt really matter. But as he said he is using db from 1999, I wouldnt be surprised its bithing about it, SQL standarts back then had to be kinda different from todays.
e: no need to write INNER btw :P