How to create join in Database Manager?

Hi All,

I'm trying to become a "power" user, and do a fancy SQL query, but it's not working for me.  I can't find a discussion about doing a basic join.

In English pseudocode, I'm trying to:

select IfName as Interface from Interfaces

select IPAddress as 'IP Address' from NodeIPAddresses

where the InterfaceIndex.Interfaces = InterfaceIndex.NodeIPAddresses

and

select Caption from NodesData

where the NodeID.NodeIPAddresses =  NodeID.NodesData

So, I can get a query that looks like:

Interface          IPAddress          Caption

Gi3/6               1.2.3.4                 MyRouterA

Po1                  5.6.7.8                MySwitchB

So, I'm trying to write a query which will selct the interface name from Interfaces, the IP Address from Node IP Addresses, and the Caption from NodesData.

I can manage A select statement, but don't know how to do the joins.

SELECT IfName as Name, InterfaceAlias as Description, NodeID, InterfaceID, InterfaceIndex FROM [dbo].[Interfaces]

Parents
  • ‌is your goal to get familiar with SQL or build the report?

    if former,

    you can use the 'legacy' report writer utility on the solarwinds server to build these kind of reports along with your filters. The edit, view SQL menu option will reveal the SQL for you.

    if latter,

    both the legacy and the new report writers have the ability to create reports like these without any need to learn about SQL

Reply
  • ‌is your goal to get familiar with SQL or build the report?

    if former,

    you can use the 'legacy' report writer utility on the solarwinds server to build these kind of reports along with your filters. The edit, view SQL menu option will reveal the SQL for you.

    if latter,

    both the legacy and the new report writers have the ability to create reports like these without any need to learn about SQL

Children
  • Thanks HolyGuacamole.  My goal is to extract useful info from Orion. emoticons_wink.png

    I'd like to understand how to do the SQL, as when I watch videos or attend SW class, it seems that's where the real experts use to get info out.  And I don't have much success at the report writing - not understanding where the data is.  At least with the db Manager, I can click on a table and see what's in it.