473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem counting rows in two tables

66
hey, this is what ive got so far:

Expand|Select|Wrap|Line Numbers
  1. ("SELECT (Select count(*) from tbl_flight_details) + (select count(*) FROM tbl_flight_departures) as grandtotal")
  2.  
i need to count all the records in the above 2 tables, following this query i need to count all the records depending on a certaion value... at the moment ive got them counting from just one table which is fine.

Expand|Select|Wrap|Line Numbers
  1.  rs6=cn.execute ("Select count(*) as cardiffdeparts from tbl_flight_departures WHERE departing_airport ='cardiff'") 
  2.  
  3.  
Mar 11 '08 #1
1 1618
amitpatel66
2,367 Expert 2GB
hey, this is what ive got so far:

Expand|Select|Wrap|Line Numbers
  1. ("SELECT (Select count(*) from tbl_flight_details) + (select count(*) FROM tbl_flight_departures) as grandtotal")
  2.  
i need to count all the records in the above 2 tables, following this query i need to count all the records depending on a certaion value... at the moment ive got them counting from just one table which is fine.

Expand|Select|Wrap|Line Numbers
  1.  rs6=cn.execute ("Select count(*) as cardiffdeparts from tbl_flight_departures WHERE departing_airport ='cardiff'") 
  2.  
  3.  
Try this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT SUM(CNT) grandtotal FROM (Select count(*) AS CNT from tbl_flight_details UNION ALL select count(*) FROM tbl_flight_departures)
  3.  
  4.  
Mar 11 '08 #2

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

Similar topics

3
by: Viswanatha Thalakola | last post by:
Hello, Can someone point me to getting the total number of inserts and updates on a table over a period of time? I just want to measure the insert and update activity on the tables. Thanks....
3
by: Alex Ayzin | last post by:
Hi, I have a problem that might be easy to solve(possibly, I've just overlooked an easy solution). Here we go: I have a dataset with 2 datatables in it. Now, I need to do the following: if...
3
by: Megan | last post by:
hi everybody- i'm having a counting problem i hope you guys and gals could give me some help with. i have a query that retrieves a bevy of information from several different tables. first let...
3
by: Peter | last post by:
Hi, This post is about counting rows and finding the max count in a group of rows. I'm trying to find the player who scored the most goals in a game. I know how to find out how many goals the...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
9
by: Miky | last post by:
I have the following problem: I am populating a dataset but, sometimes (NOT always), the NewRow method works like the Add method. SetRightDetail.RightDetail.Rows.Clear() For Each Right In...
5
by: Mr | last post by:
Hi We have a application with Framework 1.1 and Vs .NET 2003. the application has a service with pooling; like a File system Watcher, but works. the system works fine in the development...
0
by: gwilliam | last post by:
Problem with checkboxes in webpages. I am trying to re-set the values of dinamically created checkboxes in a web page, but no matter what I try the "Checked" property is not set correctly. A...
3
by: Jeff | last post by:
hey ..NET 2.0 I have a datatable which consist of 3 columns (int, date, value). This DataTable have 3 rows, the values of the "date" ("date" column is of datetime datatype) column is:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.