Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2005-06-01 14:19:41
Size: 364
Editor: SimonHuggins
Comment:
Revision 6 as of 2005-06-10 02:52:24
Size: 454
Editor: 60
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
CategoryComputingTips > SQLCompTips CategoryComputingTips > SQLComp''''''Tips
Line 9: Line 9:
=== Tip 1 === === Using substring and a sub select ===
Line 11: Line 11:
{{{
Line 14: Line 15:
}}}
Line 16: Line 18:
http://www.yipu.com.cn/shangjia/info7.html

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. http://www.yipu.com.cn/shangjia/info7.html

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