left join query

I recognized now that I didn't attach the PDF file in the previous post! Please have a look at it.
The answer to your question is that these two tables already exist in the DB and have not been created from Fabrik. What I want to do is use Fabrik to only do a select for visualization.
 

Attachments

  • Left_join2.pdf
    86 KB · Views: 262
OK, so just to be clear, when you say "these two tables already exist in the DB", you mean that the data exists as well, and you won't be using Fabrik to enter new data?

The reason Rob phrased his question the way he did, and still needs an exact answer, is that there is a restriction on how list joins work in Fabrik, so it matters as to whether when you need to link a new form to existing joined data, or create new joined data when submitting the form.

Anyway ... if your data already exists, and you have no need to input new data, and all you want to do is show existing data in "read only" lists or visualizations, then it may well be a lot easier to create a MySQL view, and use that as the 'table' to create a Fabrik (read only) List on, rather than doing it with Fabrik's native joins.

The advantage of using a view is that you can create it with (pretty much) ANY valid MySQL select statement, and what you get is what looks and feels like a table, except that it is read only. So in phpMyAdmin (or whatever MySQL client you use), you can just "CREATE VIEW your_view_name AS ..." followed by any SELECT query you want.

You'll then have what looks, smells and feels like a table, and you can create a Fabrik List on top of, and use for any "read only" purpose within Fabrik. No need to understand or use any of Fabrik's join logic or features. The only requirement we have is that you include something we can use as a "primary key" in the view, which would be usually be the PK of the main table you build the view from, as long as it's a unique integer. MySQL views do not themselves have the concept of a "primary key", but Fabrik still needs to be given something it can use as the unique rowid.

-- hugh
 
  • Like
Reactions: rob
Hi,

thanks for answer and sorry for my bad explenations! This is exactly what i was looking for!! I could create my Fabrik table as i wanted!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top