Aginity tip: using code snippets

The Aginity code snippets function is a good time-saver. To use code snippets, type in some combination of letters and hit Alt-C. Those letters then expand into a SQL statement.

By default you have

  • sf (select * from <blank> limit 1000), and
  • sfw (select * from <blank> where <blank> limit = 1000).

But you can add your own, which is where they really shine. Use them for things you type again and again.

For example, say you have a schema called modelling_team that you type over and over again. Just map it to mt .

Or say you keep selecting stuff from the sales table. Create an entry that turns sfs into select * from modeling_team.sales_table limit 1000.

One more useful one: say you want to find counts of some variable. Map it to sfg: select x, count(1) from <blank> group by x order by count(1) desc. Then hit Ctrl-H to replace x with your field(s) name and you’re good to go.