SQL Complex SELECT

POST http://localhost:9925

HarperDB supports standard ANSI SQL commands. In this call we will join the breed table on dog. We will also pull only the pups belonging to Kyle, Zach, and Stephen.

Request Body

{"operation"=>"sql", "sql"=>"SELECT d.id, d.dog_name, d.owner_name, b.name, b.section FROM dev.dog AS d INNER JOIN dev.breed AS b ON d.breed_id = b.id WHERE d.owner_name IN ('Kyle', 'Zach', 'Stephen') AND b.section = 'Mutt' ORDER BY d.dog_name"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

[{"id":347,"dog_name":"Billy","owner_name":"Zach","name":"LABRADOR / GREAT DANE MIX","section":"Mutt"},{"id":350,"dog_name":"Gemma","owner_name":"Stephen","name":"SHORT HAIRED SETTER MIX","section":"Mutt"},{"id":346,"dog_name":"Harper","owner_name":"Stephen","name":"HUSKY MIX","section":"Mutt"},{"id":348,"dog_name":"Rose Merry","owner_name":"Zach","name":"TERRIER MIX","section":"Mutt"}]