Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pattern matching in sql query

 
shashi bhushans
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to elaborate clearly what is input and what is output , you are expecting
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Deyana Vasileva
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic