What is the difficult SQL query you used in last job. Explain the scenario

Showing Answers 1 - 3 of 3 Answers

gemini burj

  • Nov 18th, 2007
 

Dear All,

As this question is depend upon your work nature and experience. As per my experience I wrote one of the difficult or a big query based on some unions and under each union query is based on many sub query i.e. columns and tables.

  Was this answer useful?  Yes

one which i faced but till yet couldnt solved was like
i am having 50 db's, each db's having 100 customers
i wanted top 10 customer for each 50 db's according to their salary in oracle

though it sounds easy but  according to my knowledge its not so

  Was this answer useful?  Yes

You can use like this

Select top 10 customer from Databasename..Tablename
union
Select top 10 customer from Databasename..Tablename
union
Select top 10 customer from Databasename..Tablename
ex:
Select top 10 customer from ABC..abc
union
Select top 10 customer from XYZ..xyz
union
Select top 10 customer from PQR..pqr

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions