Reply to All
Show messages
Messages
Inbox
Search
Login
1–7
SQL again :C
From: steve
22 Oct 2006 14:58
To: ALL
1 of 7
30966.1
SELECT * FROM stock, colours WHERE stock.pid = 10 AND
stock.stockid != 4
AND stock.colourid = colours.colourid GROUP BY stock.colourid ORDER BY colours.title
Why does it still return records with a stockid of 4?
:'S
If I change != to = then it will ONLY return that row. And I am confused and != is in the menu, the pointy-arrows do not work either
:'C
From: steve
22 Oct 2006 15:00
To: steve
2 of 7
30966.2
In reply to
30966.1
Menu = MysQL.com manual @@
From: Rowan
22 Oct 2006 15:10
To: steve
3 of 7
30966.3
In reply to
30966.1
I do not know the answer to your problem, but I would not be entirely surprised if it was something to do with GROUP BY behaving in a way you didn't quite expect. Perhaps it's just me, but I swear it does different things every time I use it.
From: steve
22 Oct 2006 15:14
To: Rowan
4 of 7
30966.4
In reply to
30966.3
Haha, suprisingly taking out the group by doesn't fix it
:(
From: Rowan
22 Oct 2006 15:16
To: steve
5 of 7
30966.5
In reply to
30966.4
Does it work if you strip it right down to summat like
sql code:
SELECT
*
FROM
stock
WHERE
stock.stockid <>
4
?
From: steve
22 Oct 2006 15:20
To: Rowan
6 of 7
30966.6
In reply to
30966.5
IT DOES WORK
:C
IT DOES WORK YES
(fail)
From: steve
22 Oct 2006 15:25
To: Rowan
7 of 7
30966.7
In reply to
30966.5
Oh no
:'S
It was working
(fail)
I had fucked up and submitted my form too many times, and the database was fucked
:$
:D