Could you please explain the use case you are trying to achieve - what is a trigger for you to see this data?
I'm not sure about the SQL part but from the UDT orion view, you can't see the devices behind the AP from the endpoint view..
If I do a search in UDT it brings up the node I want. However, on some devices it shows no info on port history. I want to be able to see the direct connection from the end point to the switch and switchport it is connected to. This is specifically a problem with Printers and HP JetDirect cards. UDT counts the JetDirect card as a port so will only show the connection and connection history to the JetDirect card, which does not help me at all. I am not concerned about clients behind my APs. I can get that info from the Wireless LAN controller. Solar Winds Port Map tool does the job. I guess I am expecting UDT to show me the same info it does.