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
  • emoticons_happy.png Nice replies here - thank you guys.

    Here is my approach: JFDI

    ... works exceptionally great.

    I hate reading manuals and I find it very boring to study admins guide and other stuff which I might never need in practical world. Waste of time - you only have 80 odd years to live, ~100 if you eat well! When you buy a new gadget (phone, hoover, USB fan) - how often you open technical manual? The best way to learn is to Just "Freaking" Do It.

    1. You have task above - you post it here - you Google it - you scratch your head - you *maybe* read technical guide at this point on this particular topic - then you get your answer.

    2. Then you go and implement this for your client/employer.

    3. Next - is very very important - you celebrate! I, for example, say "Yes!" out-loud - all the time. I have JOINed two tables! Yes! Yes! Yes!

    4. Last - you never stop improving - you come up with new idea - then you go and take same approach.

    ... then you get momentum ... then you are unstoppable ... then you suddenly become this "power" user doing fancy SQL queries ...  emoticons_wink.png

    Best Luck,

    Alex

Reply
  • emoticons_happy.png Nice replies here - thank you guys.

    Here is my approach: JFDI

    ... works exceptionally great.

    I hate reading manuals and I find it very boring to study admins guide and other stuff which I might never need in practical world. Waste of time - you only have 80 odd years to live, ~100 if you eat well! When you buy a new gadget (phone, hoover, USB fan) - how often you open technical manual? The best way to learn is to Just "Freaking" Do It.

    1. You have task above - you post it here - you Google it - you scratch your head - you *maybe* read technical guide at this point on this particular topic - then you get your answer.

    2. Then you go and implement this for your client/employer.

    3. Next - is very very important - you celebrate! I, for example, say "Yes!" out-loud - all the time. I have JOINed two tables! Yes! Yes! Yes!

    4. Last - you never stop improving - you come up with new idea - then you go and take same approach.

    ... then you get momentum ... then you are unstoppable ... then you suddenly become this "power" user doing fancy SQL queries ...  emoticons_wink.png

    Best Luck,

    Alex

Children
No Data