Re: Group By over many colums

2006-01-19 Thread Marco Neves
gt; (SELECT f4 as 'domain' from sends WHERE gameID = 1) ; > > SELECT MID(domain,INSTR(domain,'@')+1) AS 'domain' , count(*) from t_sends > GROUP by 'domain' > > > And that does the trick > > Is there any way to destroy the "t_

Re: Group By over many colums

2006-01-19 Thread Marco Neves
Hi Critters, The problem is that as your MySQL is 4.0.21 don't suport the subselect you would need to do the group. I was thinking and you have another alternative: CREATE TEMPORARY table tdata (SELECT f1 as 'domain' from sends) union all (SELECT f2 as 'domain' from sends) unio

Re: Group By over many colums

2006-01-19 Thread Marco Neves
union all (SELECT f2 as domain > > Can you spot where I am going wrong? > - > David Scott > > > - Original Message - > From: "Marco Neves" <[EMAIL PROTECTED]> > To: > Cc: "Critters" <[EMAIL PROTECTED]> > Sent: Thursday, January 19, 2006 3:

Re: Group By over many colums

2006-01-19 Thread Marco Neves
Hi, To this on I just see a solution, that depends on sub-selects, so it's available from Mysql 4.1 forward: SELECT name,count(*) from ((SELECT name1 name FROM ) UNION ALL (SELECT name2 name FROM ) UNION ALL (SELECT name3 name FROM )) tab GROUP by name; Hope this solves you problem. mpneves

Re: Interesting Query Problem

2006-01-19 Thread Marco Neves
Hi, An alternative for any MySQL version (from 3.23.??) would be: SELECT r1.question_id,count(r1.member_id) FROM Records r1 LEFT JOIN Records r2 ON r1.question_id=r2.question_id AND r2.member_id= WHERE r2.question_id IS NULL;

Re: Database design help

2006-01-18 Thread Marco Neves
Ian, I'ld like to help you, but a more specific db design would depend on more specific description on your application needs. What I can say is that you need to adapt your database to your reality. What I got til now is that you need a product table, where you can sto

Re: Database design help

2006-01-18 Thread Marco Neves
Hi, Why don't you create two table: * a product table, with the product discriptions, and other product related info (call it prod): |ID|NAME|SOME|OTHER|FIELDS| |1|ProdA|..|..|..| |2|ProdB|..|..|..| * a stock movements table, with moviments by p

Re: SELECT Row Numbers?

2005-05-10 Thread Marco Neves
oix ppl, now I have a question. I thougth that when you make a SELECT without an ORDER BY, the rows were returned in natural order, that would be some specific order (insertion order, presence in file, I don't know, but the order would be always the same). Is this unc

Re: ROW_SIZE or something alike

2005-03-17 Thread Marco Neves
oix ppl, Nobody have any sugestion that can me help with this issue? thanks mpneves On Wednesday 16 March 2005 14:09, Marco Neves wrote: > oix ppl, > > sorry for the question, but I looked in the Manual online and didn't find > nothing that do this that I'm looki

ROW_SIZE or something alike

2005-03-16 Thread Marco Neves
oix ppl, sorry for the question, but I looked in the Manual online and didn't find nothing that do this that I'm looking for, so I'm hopping someone can help me. I'm looking for some way to know the size each row of a table uses in my database (phisical - real disk space allocated or logical