Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
SELECT COUNT(*) as amount FROM rma GROUP BY orderno HAVING COUNT(*)=2
As that would give me a value stored in amount which showed the number of rma's having the same order number on 2 occasions?
Not sure if this is what i need. I need to do the following: -
rma orderno
1 456
2 456
means order number 456 has 2 entries in the rma table. I want to find the amount of orders which have 2 rma's associated with them. So i need a query that will count the number of times each order number occurs in the table. I will want to show orders which occur 2, 3, 4 and 5 times. I might have to do this with a new query for each amount or there may be a way to do it all in 1 and find the results. I want to be able to show: -
orders occuring 2 times = amount
orders occuring 3 times = amount
$i2 = 0;
$i3 = 0;
while ($row = mysql_fetch_assoc($query))
{
if ($row['amount']=='2')
{
$i2++
}
if ($row['amount']=='3')
{
$i3++
}
//would put the number with 2 of the same orderno in $i2
}
that should give $i2 = 2, $i3 = 1.
Does that look about right? Only asking as i'm not on my work pc until tomorrow, but trying to work it out so i can do it when i am, lol.