Jump to content

limit - mysql query


felito

Recommended Posts

I would like to know how can i limit the output by the number of id_offers and not the number of rows. For example

 

 

  SELECT  A.id_offer, T.tags  
        		FROM offer A
        		INNER JOIN offer_has_tags Z
                ON A.id_offer = Z.offer_id_offer
                
          		INNER JOIN tags T
                ON Z.tags_id_tags = T.id_tags
                
        		WHERE state = 0 
        		ORDER BY date
        		DESC LIMIT 0, 10

 

output:

      id_offer 	tags
        77 	     xx 
        76 	     xx 
        76 	     xx 
        75 	     xx 
        75 	     xx 
        74 	     xx 
        74 	     xx
        73 	     xx
        73 	     xx
        72 	     xx

Link to comment
https://forums.phpfreaks.com/topic/254830-limit-mysql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.