• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pattern matching in sql query

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In DETAILS_MASTER_ASSET table ASSET_ID column is there. In ASSET_ID values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001.
I want what query ll come after like statement. I wrote query like this "SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like Next wat ll come
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to elaborate clearly what is input and what is output , you are expecting
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That depends what pattern you are searching for. Can you explain?
 
shashi bhushans
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i used Ajax in my projects similar to Google search. in Google when you type starting letters, remaining letters will drop down. like that i used in my projects . output is coming. in asset_id column values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001. when i type 1 in text field it is displaying all values from asset_id column.. if i type 1 it should display which are all starts from 1.
query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like ? after like some pattern matching should be there.
asset_id is varchar data type
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shashi bhushans wrote:i used Ajax in my projects similar to Google search. in Google when you type starting letters, remaining letters will drop down. like that i used in my projects . output is coming. in asset_id column values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001. when i type 1 in text field it is displaying all values from asset_id column.. if i type 1 it should display which are all starts from 1.
query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like ? after like some pattern matching should be there.
asset_id is varchar data type




Try with

query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like "<typedString>%"

denitu
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic