Differences between revisions 4 and 5
Revision 4 as of 2005-06-01 14:20:56
Size: 401
Editor: SimonHuggins
Comment:
Revision 5 as of 2005-06-01 14:30:35
Size: 407
Editor: SimonHuggins
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
CategoryComputingTips > SQLCompTips CategoryComputingTips > SQLComp''''''Tips

CategoryComputingTips > SQLCompTips

SQL Tips

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

Using substring and a sub select

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

Group and count domain extensions.

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