Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 496961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:44:09+00:00 2026-05-13T05:44:09+00:00

The object of my query is to search for a long string in a

  • 0

The object of my query is to search for a long string in a database. To speed up this process, all records of the longstring table have a hash of that string on the same record. I want to first find all records in the table where my search string’s hash is equal to a hash on the longstring table. Then after I have that dataset, I want to compare the actual strings (since hashes aren’t always unique).

Now in oracle or mssql I would do this…

with dataset as (
  select long_string
  from longstring
  where hash = 'searchhash'
) select *
from dataset
where long_string = 'searchstring'

… but mysql doesn’t support ‘with’ clauses. So what is my best alternative in mysql?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:44:10+00:00Added an answer on May 13, 2026 at 5:44 am

    You can do it with a sub-select:

    select *
    from (
      select long_string
      from longstring
      where hash = 'searchhash'
    ) AS dataset
    where long_string = 'searchstring'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable object that contains all the data for a Table visualization.
Is there a way to populate a Dynamic object with Query String parameters? This
I have this code to get results based in search query: $(document).ready(function(){ $('#envio').click(function(){ var
I need to implement a Query Object Pattern in Java for my customizable search
As stated in http://www.boutell.com/newfaq/misc/urllength.html , HTTP query string have limited length. It can be
I'm currently doing something like this in SQLA: class Base(object): query = DBSession.query_property() @classmethod
Let's say I have a domain object that looks like this: @Entity @Indexed public
I have a query that returns valid search results using the IRavenQueryable.Search method. However,
I Just want to make sure I understand this correctly... search is an object
After a very long search I'm finally asking this question: How do I do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.