Answer the question
In order to leave comments, you need to log in
Is it recommended to make such a selection from the database?
SELECT * FROM table WHERE ID = (SELECT ID FROM second_table WHERE Name="Test")
Answer the question
In order to leave comments, you need to log in
1. maybe you meant it?
And if at you selection changes under nested request? Will you have to hardcode the value into a variable again?
You can’t do this, you can cache the result, that’s another story.
2. It is possible to write down NOW () in text. but why only?
SELECT * FROM table WHERE ID = (SELECT ID FROM second_table WHERE Name="Test")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question