Jump to content

Searching in my database, would like some help with the SQL Query


Recommended Posts

I am working on a project where I have downloaded several thousand patents from the USPTO and to make a long story short, I have reimported them into my own database.

 

The basic structure, (I am using all InnoDB), uspto.patents. In patents, I have a PK called Patent_ID, and then I have Patent_Abstract, Patent_Title, and Filed Date.

 

Patent_ID has some letters so unfortunately I am using varchar(7) instead of a numeric value

Patent_Abstract and Patent_Title are text

Filed_Date is correct sql date format

 

A couple of things that I would like to run on my db are:

 

I would like to search for terms/keywords that appear in either of the fields Patent_Abstract or Patent Title.

 

For example, I would like to search for "Solar Panels" or "*Solar" in either in the Patent_Abstract or Patent_Title. If the terms do not appear in the search results, I would like there entire record based on the PK deleted (nulled is fine). So if those search terms aren't found for that record, delete that particular Patent_ID, Patent_Abstract, Patent_Title, and Filed_Date.

 

I would also like to be able to count records based on a range or dates.

 

I've created this db, but I"m a noob at searching it and figuring out these logical sql queries.

 

Thanks for any help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.