473,471 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

count row after select statement

3 New Member
Expand|Select|Wrap|Line Numbers
  1. SELECT attnddate, COUNT(1)as v_cnt    FROM inouttime where empcode='1' and to_date(attnddate,'DD-MM-YYYY') between to_date('01-01-2011','DD-MM-YYYY') and to_date('07-01-2011','DD-MM-YYYY')
  2.    group by attnddate;
output:-
Expand|Select|Wrap|Line Numbers
  1. ATTNDDATE V_CNT 
  2. 02-01-2011 2 
  3. 03-01-2011 1 
  4. 01-01-2011 3 
hey this is my query and now i want to count the row of v_cnt so plz help me
Jan 1 '13 #1
1 1971
yarbrough40
320 Contributor
I think you mean you want to count the number of rows (records). Use a subquery
Expand|Select|Wrap|Line Numbers
  1. SELECT COUNT(v_cnt) FROM(
  2. SELECT attnddate, COUNT(1)as v_cnt    FROM inouttime where empcode='1' and to_date(attnddate,'DD-MM-YYYY') between to_date('01-01-2011','DD-MM-YYYY') and to_date('07-01-2011','DD-MM-YYYY')
  3.    group by attnddate)sq
  4.  
Jan 2 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: winderjj | last post by:
Hi, I am receiving an error when running a stored procedure with the following select statement: SELECT count(pass_num) INTO count FROM eco_class_t; The first time I run the procedure...
18
by: war_wheelan | last post by:
I am very new to Transact-SQL programming and don't have a programming background and was hoping that someone could point me in the right direction. I have a SELECT statement SELECT FIXID,...
1
by: rickn | last post by:
Being new to VB and programming, I'm not sure how to modify the following or if required have a Select statement to NOT allow any duplicates. I'm trying not to have any duplicates in the LOTNUM_72...
3
by: ian.l.guthrie | last post by:
I have a table consisting of two fields, OStype and OSversion, with entries like: OStype OSversion solaris 2.5 solaris 2.6 redhat 6.2 redhat 6.2 solaris 8 redhat AS4
1
by: VB Programmer | last post by:
I have a SqlDataSource I setup on an ASP.NET 2.0 webform. I setup the SELECT statement and it has 1 parameter, @ProductId. How do I, using VB.NET, store the results of that SELECT statement...
2
by: bhanab | last post by:
Hello, Please can someone help me with this select statement? How do I get the statement to keep the week number static? ie if there are no values then it should show up as NULL, zero or just stay...
2
by: smckibbe01 | last post by:
I've written class in C# that performs a select statement in SQL Server and retrieves the reader rows into a DataTable. I then use the DataTable to populate a datagrid, listbox, etc... I think...
2
by: kxyz | last post by:
Hello everyone, I need help with a stored procedure or two. My stored procedures are supposed to check if a certain record exists. If it does exist, then I select everything from that row, as...
25
by: ramprat | last post by:
Hi All, I'm essentially trying to extract a value from the pre_05_growth_factor column of my traffic table and assign it to a variable to be used later. Does anyone know why the code below...
2
by: ankitmathur | last post by:
Hi All, I'm facing a problem I'm unable to find a solution for. I hope fellow members would be able to help me out. System Info: PHP v5 MSSQL 2008 Linux box
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.