The question is not clear enough, and much more details are needed.
What database ?
What do you mean by “doesn’t respond” ?
What tool are you running the query on ? Are you running the query from an application ? if so, what programming language ?
Can you post your code ?
and what is the front end, i mean java or .net ur using to connect the data base?