Question
FOR SQL users. How would I use this function to find a value. I want to find all the search results for New York with
FOR SQL users. How would I use this function to find a value. I want to find all the search results for New York with a given number_of_locations for the year at each of the IP_locations. What query would I use to specifically give me a sum of the number_of_locations for the year at the IP_locations for the state of New York. The following query returns a result but it is hard to determine.
SELECT CONCAT(s.state_code,' - ',s.state_name,' - ', w.city_name,' - ', w.IP) AS IP_location,
COUNT(*) AS number_of_locations,
EXTRACT(month FROM event_begin_time) AS month,
EXTRACT(year FROM event_begin_time) AS year
FROM census_data w
INNER JOIN state_data s ON w.state_code = s.state_code
GROUP BY IP_location, month, year
ORDER BY number_of_locations DESC
LIMIT 50;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started