cenorasped Posted March 19, 2012 at 11:35 AM Report Share #444586 Posted March 19, 2012 at 11:35 AM valores de url 64.4.34.129/gateway/gateway.dll?SessionID=16813406 pt.oriflame.com/utils/flash/font-config.jhtml?font rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMPGTA rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMPGTE Como fazer uma query que me mostre o seguinte resultad: 64.4.34.129 - 1 pt.oriflame.com - 1 rad.msn.com - 2 como chegar à "/" e cortar o resto?? Link to comment Share on other sites More sharing options...
fil79 Posted March 19, 2012 at 11:49 AM Report Share #444594 Posted March 19, 2012 at 11:49 AM Quando estiveres a listar os resultados podes usar o explode para fazeres isso: http://php.net/manual/en/function.explode.php MCITP-MCTS-MCP Link to comment Share on other sites More sharing options...
cenorasped Posted March 19, 2012 at 11:52 AM Author Report Share #444596 Posted March 19, 2012 at 11:52 AM mas por exemplo... valor:"rad.msn.com/ADSAdClient31.dll?GetAd=&PG=IMPGTA" com apenas sql é possivel returnar : "rad.msn.com"??? Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted March 19, 2012 at 11:58 AM Report Share #444598 Posted March 19, 2012 at 11:58 AM testado e a funcionar como pretendes (MySQL) : SELECT SUBSTRING_INDEX( text, '/', 1 ) , COUNT( SUBSTRING_INDEX( text, '/', 1 ) ) FROM test1 GROUP BY SUBSTRING_INDEX( text, '/', 1 ) PS : claro que tens de alterar o nome da tabela e o nome do campo com as entradas ... IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
cenorasped Posted March 19, 2012 at 12:13 PM Author Report Share #444605 Posted March 19, 2012 at 12:13 PM muito obrigado HappyHippyHippo!! Era mesmo isto que queria! Cumprimentos, cenorasped Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now