• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need HQL

 
Roopesh Rana
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I required HQL

There is two tables
One is User table which is having 3 columns
Userid
username
userpassword

Second is Search table which is having 3 columns
Userid
Search content
Search time

Now I need HQL, will return all userid, which searched something just 15 min befor.

If anybody have idea please revert me.
 
Maneesh Godbole
Saloon Keeper
Posts: 11327
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roopesh Rana wrote:I required HQL ...
Now I need HQL, will return all userid, which searched something just 15 min befor.

Sorry. Thats not how the Ranch works. Please read =>NotACodeMill
What have you tried so far and where are you stuck?
 
Roopesh Rana
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried this

 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15628
46
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That query looks like something entirely different than what you asked in your first post.

You asked for some query for all user ids which did a search in the last 15 minutes.

The query you are posting now seems to select user ids from users which are geographically located within a certain distance from some point.

So, what is your question about? By the way, the answer to your first question is really simple. Just do a select from search_table where search_time < something.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic