Join question

Join question

kenraynerkenrayner Posts: 11Questions: 4Answers: 0

Hello

In this example:

http://editor.datatables.net/examples/inline-editing/join.html

If, for example, the member of staff had a second site where they sometimes worked and that was stored in the database as users.site2 - but still referenced sites.name to find out the actual site name rather than its number, how do I implement that? I keep getting a "duplicate field detected" error.

Any help greatly appreciated!

Regards

Ken

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Hi Ken,

    What you would need to do is alias the second join (so it is called something else) - which unfortunately is not something that Editor supports at the moment.

    I'm going to be looking into adding that feature at the start of next week, hopefully for inclusion in the next release. It depends on how much work it involves.

    At the moment the only other option is to use a one-to-many join, but that might not suit your database schema.

    Allan

  • kenraynerkenrayner Posts: 11Questions: 4Answers: 0
    edited October 2015

    Don't worry, I've put my brain in gear...

    create view sites2 as select * from sites
    

    Then use sites2... :-)

    Thanks for the quick reply.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    That will do nicely! Nice one :-)

    Allan

This discussion has been closed.