Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
how to get records count by hourly wise?
Posted By :
Posted Date :
November 22, 2010
SELECT Count (*), to_char(col_datetime,'yyyymmdd HH24') FROM tblname where Trunc(col_datetime) =Trunc(SYSDATE-1) group by to_char(col_datetime,'yyyymmdd HH24')
You can also find related Interview Question to
how to get records count by hourly wise?
Using query analyzer, name 3 ways to get an accurate count of the number of records in a table?
SELECT * FROM table1
SELECT COUNT(*) FROM table1
SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND indid < 2
What aggregate functions returns a row count as an integer?
How to get the column count of a report?
SY-LINSZ system variable gives the column count (line size) and SY-LINCT for line count.
What is COUNT Syntax?
SELECT COUNT("EMPLOYEE_NAME") FROM "EMPLOYEE_TABLE";
SELECT COUNT(*) FROM "EMPLOYEE_TABLE";
COUNT is arithmetic function, This is return number of row.
COUNT and DISTINCT Syntax?
SELECT COUNT(DISTINCT EMPLOYEE_NAME) FROM EMPLOYEE_TABLE;
Fetch the number of distinct entries in a Employee_table.
select COUNT(column_name) from table_name counts only
NON NULL Columns
How To retrive Duplicate Records when There is no Primary key in a Table?
group by city_name
having count(*) > 1
How to get last five minuts records from Oracle Databse table?
select col_datetime,sysdate from tblname where trunc(col_datetime)=trunc(sysdate) and to_char(col_datetime,'dd-mm-yyyy hh24:mi:ss')>to_char(sysdate- interval '05' minute,'dd-mm-yyyy hh24:mi:ss')
If you 1Lakh records of employee in a table, then how will you get the 4th highest salary from the table?
SELECT TOP 1 * FROM [EmpTable] WHERE [salary] NOT IN (SELECT DISTINCT TOP 3 salary FROM [temp1] ORDER BY [salary] DESC) ORDER BY salary DESC
Would the select query below fetch any records?
create table #testvm (ID int)
select * from sysobjects where name = '#testvm'
drop table #testvm
Since temp tables are created in tempdb, and use a random name, the query will not work.
If you used a query like this, you would see your table:
select * from tempdb..sysobjects where name like '#testvm%'
Performance wise which one is the best? IN,EXISTS or INNER JOIN
Generally speaking JOINs are much better than EXISTS & EXISTS is better than IN, performance wise.
If your result set is small then you can use IN or EXISTS.
But if result set contains a large set of records, then use JOINS.
i have 3 aspx pages: page1.aspx, page2.aspx, page3.aspx. i have one Database table Employee (Empname, Age, EmpId, mobile, Country) with 1000 records inserted. now i want to retrieve the records in page1.aspx only once and i should use this data between the 3 pages without using Session variable. How to achieve this ?
need help on this question
i have one aspx page. Only one text box i have in that page. i have retived the records from the Database. now i want to assign the value to the text box with out writing the code in aspx.cs textbox.text = . But value has to be assigned to that text box. how to achieve this ?
how to achieve this ?
You are working on an ASP.NET application. One of the drop down list contans 1 lakh records. The page posting becomes very slow. How to overcome this? You just need the selected index of the dropdownlist on submit.
Use EnableVieState=false. On the dropdown change event, set a hidden field value to the selected index.
Disabling view state helps us in reducing the postback load.
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend