Hello!
The one example with the sub selects does not work. I suppose it's because MySQL does not support any sub selects.
But the other two examples work really great! :)
I think I will use the last example you posted. It is the easiest one to extend.
I will have to look into this...
Hey it's me again...
as I already said, the only version which works is the first one posted by carp.
Now I've got another problem...
How can I easily extend the select thingy?
Let's say now I want all the ID2's which have ID1=1 ID1=2 ID1=3 in common? or in other words ID1=1 ... ID1=n ?
I...
Alright...
...now i understand HOW it works. and finally i got the first example shown by carp run successfully. if i use yours which is quite similar but also different to that one i receive an error "1064"?
I'd like to know what is wrong with it?! For a better understanding of the...
Somehow my last answer was not sent properly.
Anyways i use "MySQL" and the result of this SELECT will be used in "PHP".
I am pretty new to SQL and I guess that is the reason for my probs. :)
I thought those other two suggestions would use two tables instead of one. I guess...
Hi!
Well I use MySQL. The result of the whole "SELECT" thingy will be used in PHP.
You say that the suggested solutions refer to ONE table. Then I must have misunderstood them. As i already said I am quite new to SQL, so maybe you could try to explain it to me once again.
I hope there...
Hello everybody!
This approach:
SELECT id2
FROM myTable
WHERE id1 = 1
INTERSECT
SELECT id2
FROM myTable
WHERE id1=2;
caused an error. Maybe I should say that I use MySQL ? I am kinda new to this SQL-stuff...
Besides this: I only have ONE table with those two fields ID1 and ID2.
TIA. If you...
Hmmm... wouldn't that be the same as this:
SELECT * FROM MyTable WHERE ID1 = '1' OR ID1 = '3'
?
Because both (your version and mine) do not give me the desired result :-(
But maybe i got you somehow wrong. Untill now I never heared of that "in" command.
TIA!
Oliver
Hey yall.
I've got a table which looks like this:
ID1 ID2
1 1
1 2
1 3
2 1
2 3
3 1
4 4
I want to have all those ID2's which have ID1=1 and ID1=2.
Desired result would be:
ID2: 1 and 3.
It might look kinda weird but i hope that you get what i want.
Thanks...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.