06-14-2013 07:01 AM - edited 06-14-2013 07:28 AM
I am developing my first BB10 App using HTML Web Works, in my app I am using HTML Sqlite API for database, its working fine.
I am facing problem in fetching data from 3 tables, scenario is that I have 3 tables:
Doctors (id, name), Specs (id, name), doc_specs (id, d_id, s_id)
now on Doctor Profile I want to display all specialties of selected doctor.
Kindly help me selecting Name of all Specialties of doctor where ID='x'
I will be very thankful to you ppl.
06-14-2013 03:56 PM
SQLlite is sorta just that - very lite
You can't so a Join
It would be possible is some Open Source DB was ported to BB10 - MySQL would do nicely as would PostGres
I would suggest you join a discussion here to get it in the plan (there ain't one)
06-26-2013 06:00 PM
It's been a while since I've touched SQLite; perhaps you can't use the JOIN command, but I believe something like so should do it:
SELECT DISTINCT Doctors.name, Specs.name FROM Doctors, doc_specs, Specs WHERE Doctors.id='x' AND Doctors.id=docs_specs.d_id AND docs_specs.s_id=Specs.id;
Note: Not tested. Not efficient. But I believe that should retrieve the desired results.