I am trying to execute an SQL query, which as a result also spills out a number of qualification rows from another table.
Here's the current request inserted into sprintf:
CHOOSE a. * FROM websitesAS a WHERE website_id=% d
Then I have a request to get the number of unique visits (from the visit table) for this site:
SELECT * FROM website_visitsWHERE website_id=% d GROUP BYvisitor_id
Now, is there a way to insert this request inside the first so that I can get the number of unique visits as part of the result of the first request? It should be something like this:
SELECT a. *, (SELECT * FROM website_visitsAS b WHERE b. website_id= A. website_idGROUP BY visitor_id) AS unique_visits FROM websitesAS WHERE website_id=% D
But ... as for the end of the performance, I'm at a standstill. Any help you can provide is appreciated!
source
share