Forum: MySQL Oct 8th, 2009 |
| Replies: 2 Views: 401 Try this
Select a,b,c,d,e,f from
(
(SELECT a, b, c, d, e, f, DATE
FROM table1 WHERE a=10 AND b=1)
UNION
(SELECT a, b, c, d, e, f, DATE
FROM table1 WHERE a=11 AND b=1) |
Forum: MySQL Aug 10th, 2009 |
| Replies: 3 Views: 398 Glad I could help. Can you mark the thread solved if your problem has been fixed.
Thanks. |
Forum: MySQL Aug 7th, 2009 |
| Replies: 3 Views: 398 The first thing you need to do is replace the left join with an Inner join. Right now you are joining all the customers even if they do not have any orders which is a waste of resources when you are... |
Forum: MySQL Jul 21st, 2009 |
| Replies: 8 Views: 625 Try this
SELECT MAKE.MAKE, MAKE.count, color.Color, color.count
FROM(
SELECT MAKE, count(*)count
FROM cars
Group by MAKE
)MAKE,
( SELECT MAKE, color,... |
Forum: MySQL Jul 21st, 2009 |
| Replies: 8 Views: 625 Nevermind, I take it the attachment is the table schema.
Is it important to do it all in one query. What are you using the resultset for because if you do it in one query you will most likely get... |
Forum: MySQL Jul 21st, 2009 |
| Replies: 8 Views: 625 Since you didn't give too much information I thought of a few other interpetations of what you asked.
If field1 is a numeric value you might want the sum of the field grouped by field2
Select... |
Forum: MySQL Jul 21st, 2009 |
| Replies: 8 Views: 625 do you mean something like this
Select field2,count(Field1)
From Table
Group by field2 |