Just nu i M3-nätverket
Jump to content

select inuti select


raiTA

Recommended Posts

Hej!

Hur fungerar det om man vill göra en query med SELECT inuti en annan SELECT?

 

ex: "SELECT * FROM table WHERE fileID = (SELECT fileID FROM table WHERE id=2) ORDER BY id"

 

Jag får inte ovanstående att fungera.

 

Tack.

 

Link to comment
Share on other sites

Anjuna Moon

SELECT * FROM table WHERE fileID IN (SELECT fileID FROM table WHERE id=2) ORDER BY id

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...