Shravan Jain Shravan Jain - 1 year ago 86
SQL Question

SQL for getting each category data in maria db

I need to fetch 4 random values from each category. What should be the correct sql syntax for maria db. I have attached one image of table structure.

Please click here to check the structure

Should i write some procedure or i can do it with basic sql syntax?

Answer Source
SELECT column FROM table WHERE category_id = XXX 

do it for all categories

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download