select Statement
The select statement is used to retrieve data. For well-designed HTTP APIs, a select
maps to an HTTP GET. But if your APIs are using POST over XML or SOAP, a
select may map to a POST request.
select {*|comma-separated columns with/without aliases} from
{table|table1 as alias1, table2 as alias2}
where {conditions}*
limit {number}
offset {number}
Examples
Select All
Try meselect * from finditems where keywords='iPhone'
This returns the complete response in JSON format. If the API returns XML, the XML will be transformed into JSON.
Select Fields
Try me
select title, itemId, primaryCategory.categoryName,
sellingStatus.currentPrice from finditems where keywords='iPhone'
This returns results in a tabular form, with each row containing the selected fields.
Select Fields with Aliases
Try me
select title as title, itemId as id, primaryCategory.categoryName as category,
sellingStatus.currentPrice as price from finditems where keywords='iPhone'
Nested Select
Try me
select ItemID, ViewItemURLForNaturalSearch, Location from details where itemId in
(select itemId from finditems where keywords='mini cooper');
Join
Try meselect e.ItemID as id, e.Title as title, e.ViewItemURLForNaturalSearch as url, g.geometry.location as latlng from details as e, google.geocode as g where e.itemId in (select itemId from finditems where keywords = 'mini') and g.address = e.Location
Clauses
Columns Clause
List of columns with or without alias names, or *
When using aliases, all selected columns must be aliased. Aliases must be prefixed with
as.
From Clause
Up to two tables, in the natural order of dependencies.
When using a join, table names must be followed by as and an alias name.
Where Clause
List of zero or more conditions. Conditions must be separated by an and. Two types
of conditions are supported.
- Equals, using the
=operator - Nested select, using
inclause
Limit
The value of the limit is used to limit the number of results.
Offset
The value of this parameter is used to paginate a response.
