If you're used to writing SQL, it'll take you just a few minutes to get used to Trevor.io's interface.
- In Trevor.io, you build queries as a series of atomic steps.
- Each extra step you add modifies the results in some way.
- There are very few limits to number of steps you can add and the complexity you can therefore layer into your query.
Here are some examples of how to basic SQL operations in Trevor.io.
SELECT * FROM Extras ORDER BY price DESC
SELECT * FROM Customers WHERE nationality = 'United States' OR nationality = 'Germany'
SELECT country, COUNT(*) FROM Customers GROUP BY country
4️⃣ Group by week
SELECT DATE_TRUNC('week', pick_up), COUNT(*) FROM Reservations GROUP BY 1
5️⃣ Specify time range
SELECT * FROM customers WHERE signed_up_at < ('now'::TIMESTAMP - '6 months'::INTERVAL)
6️⃣ Join with a group by
coalesce(sum(p.price_usd), 0) as "sum_price_usd"
LEFT JOIN products ON o.product_id = p.id
GROUP BY 1
ORDER BY "sum_price_usd" DESC