cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1052
Views
5
Helpful
4
Replies

SQL Help with DBreader

GeorgeLarson
Level 1
Level 1

I am trying to do a left join in the sql statement, but it keeps erroring out. If I take out the left, it joins the tables, but I don't get all the data I want. Can someone tell me how to do a left join? Everything I have read on Sybase says the left join should work.

4 Replies 4

nhabib
Level 9
Level 9

What is the exact syntax of the statement that you are using?

SELECT dev_fqn.Device_Name, dev_domain.Device_Domain_Name

FROM dev_fqn LEFT JOIN dev_domain ON dev_fqn.Domain_Id = dev_domain.Domain_Id

This should bring up all the records from dev_fqn and if there is a matching record in dev_domain.

I exported all the tables from rme to access and can run this statement in access and it works fine.

If I take out the left keyword, then dbreader runs but I don't get all the records from dev_fqn table.

Try this one instead:

SELECT dev_fqn.Device_Name, dev_domain.Device_Domain_Name FROM dev_fqn LEFT OUTER JOIN dev_domain ON dev_fqn.Domain_Id = dev_domain.Domain_Id

That worked. Where do you find this stuff. I can find no reference for dbreader specific to CiscoWorks.