Join command for Views

Events happening in the community are now at Drupal community events on www.drupal.org.
kiernan's picture

Does anyone know where I can find info on whether Views allows a join query?

Thanks for the input.

Kiernan

Comments

views attach

tlangston's picture

Depends on what you are trying to join but I've been able to get related date via the Views Attach module and nodereference.

Thanks for getting back to

kiernan's picture

Thanks for getting back to me. I will take a look.

Kiernan

  • Kiernan

Look at "relationships"

arthurf's picture

Depending on what data you need to join, "relationships" are ways that views can join together data. You can also see the raw sql that views creates in preview as well.

Hello Arthur, Thank for the

kiernan's picture

Hello Arthur,

Thank for the input. This is what I am trying accomplish. For starts I have two tables:

table A contains doc_id field and other fields

table B has proc_id and doc_id

I want to view all rows in table B where doc_id matches doc_id in table A.

This is step one. I am struggling to get this to work.

My next step is to link table B to table C.

table c contains proc_id and description fields of procedures.

Ultimately I would like to select a doctor and view all procedure the doctor preforms or be able to select a procedure and list the corresponding doctors.

Is there a configuration I need to set to see the raw sql in the views preview?

Cheers

  • Kiernan

If you're using standard

arthurf's picture

If you're using standard drupal data (nodes with fields) this kind of thing is pretty straight forward. From your post it sounds like maybe you're not?

Vermont

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: