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 9181263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:14:48+00:00 2026-06-17T18:14:48+00:00

We would like to filter purchase orders either based on purchase order id (primary

  • 0

We would like to filter purchase orders either based on purchase order id (primary key) or name of the purchase order using a single search box.

We used the like parameter to search on the name field, but it doesn’t seem to work on the primary key. It works only when we use the equal operator for id(s). But it would be preferable if we can filter purchase orders using like for id(s). How to do this?

create table purchase_orders (
id int(11) primary key,
name varchar(255),

...
)
  • 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-06-17T18:14:49+00:00Added an answer on June 17, 2026 at 6:14 pm

    Option 1

    SELECT *
    FROM purchase_orders
    WHERE id LIKE '%123%'; -- tribute to TemporaryNickName
    

    This is horrible, performance-wise 🙂

    Option 2a

    Add a text column which receives a string version of id. Maybe add some triggers to populate it automatically.

    Option 2b

    Change the type of id column to CHAR or VARCHAR (I believe CHAR should be preferred for a primary key).

    In both 2a. and 2b. cases, add an index (maybe a FULLTEXT one) to this column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have a datatable that I would like to filter with a single
I would like to filter an array of items by using the map() function.
I have a grouped query, and would like to filter it based on count(*)
I would like to filter my @jobs using two parameters. For now I have
I would like to filter a linq Lookup based on its values: the lookup:
I would like to filter entries from web.sitemap using OnDataBinding event, but it does
Using the Wireshark Filter field in the Wireshark GUI, I would like to filter
I would like to filter a image using ImageJ API. The ImageJ libary is
I would like to filter my jqGrid based on certain cell values. For example,
I would like to filter NSMutableArray elements that contains some string. ListArchives is filled

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.