I'm having a bit of bother. I have two tables, one is called da7hdr and contains the main details for what I'm doing.
I then have a table called da7hdrd which relates to da7hdr by each of its records having a value called hdr_key which references the da7hdr.hdr_key (so it's a foreign key if you like)
Now, these two tables should contain the exact same amount of records but they dont so I want to see which records in da7hdr dont have a corresponding value in da7hdrd. So I thought the simplest thing would be to do a left join on da7hdr, da7hdrd where da7hdr.hdr_key = da7hdrd.hdr_key but it just hangs.
I believe this to be because the two tables contain the identically named field 'hdr_key'. I have searched the web and seen ideas with USING but it still just hangs when I try them out. The simplest option would be to rename the hdr_key field in da7hdrd but I just dont want this thing to beat me, any ideas?
Jo
I then have a table called da7hdrd which relates to da7hdr by each of its records having a value called hdr_key which references the da7hdr.hdr_key (so it's a foreign key if you like)
Now, these two tables should contain the exact same amount of records but they dont so I want to see which records in da7hdr dont have a corresponding value in da7hdrd. So I thought the simplest thing would be to do a left join on da7hdr, da7hdrd where da7hdr.hdr_key = da7hdrd.hdr_key but it just hangs.
I believe this to be because the two tables contain the identically named field 'hdr_key'. I have searched the web and seen ideas with USING but it still just hangs when I try them out. The simplest option would be to rename the hdr_key field in da7hdrd but I just dont want this thing to beat me, any ideas?
Jo