Differences between revisions 1 and 2
Revision 1 as of 2005-06-01 14:19:41
Size: 364
Editor: SimonHuggins
Comment:
Revision 2 as of 2005-06-01 14:19:59
Size: 376
Editor: SimonHuggins
Comment:
Deletions are marked like this. Additions are marked like this.
Line 12: Line 12:
 SELECT SUBSTRING(domainname FROM POSITION('.' in domainname)) FROM orders WHERE type=1) AS foo
 GROUP BY substring;
[[br]] SELECT SUBSTRING(domainname FROM POSITION('.' in domainname)) FROM orders WHERE type=1) AS foo
[[br]] GROUP BY substring;

CategoryComputingTips > SQLCompTips

SQL Tips

This is more a collection of recipes than tips I guess.

Tip 1

SELECT COUNT(substring),substring FROM ( br SELECT SUBSTRING(domainname FROM POSITION('.' in domainname)) FROM orders WHERE type=1) AS foo br GROUP BY substring;

Group and count domain extensions.

TheEarthWiki: SQLCompTips (last edited 2008-02-19 15:39:15 by localhost)