Write down the SQL Query to fetch 50% rows from total records?

preview_player
Показать описание
Hi Guys
As part of SQL Interview Question Series I have explained below question.
Write down the SQL Query to fetch 50% rows from total records?

#ntile #pyhon #etl #etltesting #sql #operator #operatorsinjava #interview #oracle #job #dwh #informatica #it #sql_server #db2 #postgres #postgresql #teradata #mysql #hive #hdfs #data #dataengineeringessentials #dataengineering #dataengineer #dataanalytics #datascience #dataanalysis #odd #evenrecords #dataengineer #java #pyhon#sql #sql_server #postgresql #postgres #dataanalytics #hdfs #sql #development #pyhon #dwh #plsql #db2 #dataengineer #teradata #dataengineer #mssqlserver #msdhoni #msexcel #interview #interviewquestions #views #subquery #inlineview #businessanalystcourse #businessanalyst #sybase #postgres #mssqlserver
Рекомендации по теме
Комментарии
Автор

We can get the 50% or any % of records from table using other method
select * from emp where rownum<= (select count(*)*.5 from emp);
Here count(*) * followed by your % of records

manjunathamc-xn
Автор

My Question in this scenario Salary in ascending order in the input due that reason, your query work, if the salary in random order how you fetch 50% of the records

ramukodama