Is it possible to create a nested select statement something like this in mysql?
SELECT * from myTable WHERE id = (SELECT id from data where dataId = 1);
If this is not the correct way to formulate such a statement could anyone point me in the right direction for the way in which it should be formulated.
Thanks
This syntax is fine. Note though that this will only work if there is one data with dataId 1.
If there is likely to be multiple ids returned by the inner select then it is better to use: