Hi all
I am trying to do the following:
2 tables
Only common element is an id field
Table 1: id field is called fileid
Table 2: id field is called id
it also has a field called filename
What I am trying to do is
Count the number of times fileid appears in table 1. Then using fileid, cross reference with table 2 and find out what the filename is
so far I have had little success
Below is the query I am using, but as you will see it doesnt work.
Can anyone show me where I have gone wrong, or what I should be using (praying it doesnt involved JOINs)
select t1.fileid as fileid, DISTINCT COUNT(t1.fileid) AS fileid_count, t2.filename as filename from owners_files as t1, files as t2 order by lower(filename) asc