Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How could I write this inner select

Posted on 2014-10-15
3
Medium Priority
?
160 Views
Last Modified: 2014-10-16
Here's the portion of my table that I want to select from:

select id, actor_id, actor_display_name, posted_time, display_name, geo_coords_lat, geo_coords_lon, location_name, posted_day from verizon where posted_day BETWEEN '2014-03-01' and '2014-03-05'

Open in new window


I want that to be my nested query. How do I grab from that inner select a range of geo_coords_lon and geo_coords_lat?

In other words, I want to select from my inner select those rows that are within a given latitude and longitude range.

How?

BTW: I have tried to create a temporary table and while that approach does work, I'm trying to avoid a situation where I'm "writing" anything in that it takes more time than a select statement. I just need that select statement to be limited to the subquery that I've written.

What do you think?
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 40382378
I think the temporary table with ENGINE=MEMORY is almost certainly what you want.

INNER is a term of art in database work; I'm not seeing any applicability here.

How many rows do you expect to get from the query as written?
0
 

Author Comment

by:brucegust
ID: 40385321
Ray, I went with an earlier suggestion you made as far as inserting directly from a select statement. Worked like a peach!

Thanks!
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40385352
Thanks for the points.  I hope you'll take a moment to abstract out a subset of that big table, perhaps every 1000th row, and post a link to it.  If we have some test data to work with, we can give you better solutions that are more on point when we are answering these questions!

All the best, Ray
0

Featured Post

Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question