CodingEasy MySQL probably :(

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  beseku  
 To:  steve      
30083.3 In reply to 30083.1 
SQL code:
SELECT a
FROM bum
WHERE b IN (5, 7)
GROUP BY a
HAVING COUNT(*) > 1

Ben.
-------------------------------
beseku.com
beyondstandards.com
flickrshow.com

0/0
 Reply   Quote More 

 From:  beseku  
 To:  beseku     
30083.4 In reply to 30083.3 
Bugger

Ben.
-------------------------------
beseku.com
beyondstandards.com
flickrshow.com

0/0
 Reply   Quote More 

 From:  steve   
 To:  Peter (BOUGHTONP)     
30083.5 In reply to 30083.2 
The bottom one worked thankyou :D

Now I shall just study them so I can learn what they mean :$ *has only just figured out JOINS*

0/0
 Reply   Quote More 

 From:  steve   
 To:  beseku     
30083.6 In reply to 30083.3 
Thankyou too ^_^

Now! I may aswell ask, as I think this may be a join :$

I have a table where BID actually means something, and it's those records I'd like retreived. This table for this scary LID and BID thing is one that links them ^_^

I have mastered joins on normal queries :$ But I fear this may be more complicated XD

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  steve      
30083.7 In reply to 30083.6 
I think this is what you want...

sql code:
SELECT *
FROM second_table
WHERE bid IN (
              SELECT bid
              FROM first_table
              WHERE lid IN (2,8)
              GROUP BY bid
              HAVING COUNT(*) > 1
             )
0/0
 Reply   Quote More 

 From:  steve   
 To:  Peter (BOUGHTONP)     
30083.8 In reply to 30083.7 
Aaaaaaaah! Awesome! Thankyou! I didn't know you just put a whole query in another query :O

IS THAT CALLED A SUBQUERY? :O

*awaits ben's reply*

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  steve      
30083.9 In reply to 30083.8 
No, it's called a Disilekad.





(Yes, it's a subquery)
0/0
 Reply   Quote More 

Reply to All    
 

1–9

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats