1

Setting: RODBC package loaded SQL connection

How to: Extract data from the SQL db from two different tableS which are related. How to define the relation when running a query?

zx8754
  • 52,746
  • 12
  • 114
  • 209
PDG
  • 287
  • 1
  • 3
  • 14
  • I don't think you can have *"relationships"* between objects in R. – zx8754 Nov 04 '16 at 07:14
  • So that means that I have to define the relationship in the query always? When I extract related info of multiple fields from different tables? – PDG Nov 04 '16 at 07:31
  • What package are you using to access SQL db. – zx8754 Nov 04 '16 at 07:40
  • The RODBC package. I can access the db tables and thus the fields. I'm now struggling how to extract info from different tables and fields in such way that the relation is kept – PDG Nov 04 '16 at 07:51
  • As it stands, this post will be closed as "Too broad". Read about XY problem, tell us what we are trying to achieve by keeping relationships within R. Usually, we extract data into R object(data.frame?) using some SQL package, then manipulate data. – zx8754 Nov 04 '16 at 07:55
  • Ok I will rephrase – PDG Nov 04 '16 at 08:03
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/127355/discussion-between-zx8754-and-pdg). – zx8754 Nov 04 '16 at 08:10
  • Can't close question – PDG Nov 04 '16 at 09:23

0 Answers0