Database |> Language |> Keywords |> 

SELECT

Contents

Definition

If you’re familiar with ordinary SQL databases then you’re also familiar with the idea of SELECT’ing columns from rows in a table. In LSD SQL, pages are treated like tables and you can SELECT CSS selectors as though they were columns:

lsd <| https://lsd.so |
tagline <| h1 |

FROM lsd
|> SELECT tagline



Example

Suppose we were interested in obtaining the names of companies in a VC’s portfolio; we can simply go and grabbed every link on the page like so:

vc_portfolio <| https://www.abstractvc.com/companies |
repeating_container <| h2.title |
portco <| a |

FROM vc_portfolio
|> GROUP BY repeating_container
|> SELECT portco




Related: