Jump to content

mysql query


cenorasped

Recommended Posts

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

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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.