473,956 Members | 9,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

merge two queries into one

232 New Member
State wise count of excellent (max pass count centres)
query1->
Expand|Select|Wrap|Line Numbers
  1. Select  code,sum( IF(PASS_FAIL='P',1,0)) AS Cp from table group by code
I made table5 from above query then i executed query2 to get desired data
Query2->
Expand|Select|Wrap|Line Numbers
  1. SELECT Sheet1.state, code,Sheet1.address,stdcnt
  2. FROM Table5 INNER JOIN Sheet1 ON Table5.code = Sheet1.centrecode
  3. order by state,stdcnt  desc;
kindly help me to merge these two queries into one
Nov 13 '09 #1
1 2059
code green
1,726 Recognized Expert Top Contributor
it would be helpful if you could be bothered to:
1. Use code tags
2. Used accepted standards of syntax
3. If you don't follow standards at least be constent
Anyway
Expand|Select|Wrap|Line Numbers
  1. Select code,sum( IF(PASS_FAIL='P',1,0)) 
  2. AS Cp from table group 
  3. INNER JOIN 
  4. (SELECT Sheet1.state, code,Sheet1.address,stdcnt
  5. FROM Table5 Sheet1)
  6. ON Table5.code = Sheet1.centrecode
  7. order by state,stdcnt desc;
  8.  
Something along those lines
Nov 13 '09 #2

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

Similar topics

0
3161
by: Johannes B. Ullrich | last post by:
--=-WKgoK98ejo9BZyGYc3N/ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I am having problems with MySQL 4.0.12 on RedHat Advanced Server 2.1 using a dual Xeon with 8 GByte of RAM. I have a database collecting logs. Each day, a new table is created. In order to allow for queries across more than one day, I use 'MERGE'
2
15094
by: Philippe Bouffaut | last post by:
Hi all, Here is my problem, I have 3 tables : People ------------- IDPeople Firstname Lastname
6
2575
by: Charlene | last post by:
I'm trying to set up a mail merge using a query out of my database for the data source. When I browse for a data source and open my database, only a few queries from the database are listed - the one I want of course is not there. Does anyone know how I can list all the queries and then be able to select the one I want. Thanks! Charlene
8
5170
by: Darryl Kerkeslager | last post by:
I hope that although this is 25% Access and 75% Word, that someone will know ... The whole problem here arises because 1) Microsoft acknowledges an 'issue' wherein TextInput type FormFields are lost when doing a MailMerge and 2) the fix that they have proposed is both inadequate and won't work from Access. http://support.microsoft.com/?kbid=286841 The part of the code below that actually performs the merge is great; the core of it is...
0
2762
by: Shiraz | last post by:
Hi I have a question regarding the functionality of merge modules. Since this relates to my previous queries, I'll just give you a brief background on the topic. I had to make an installer for an application which was to share dlls with another application and these dlls were not self-registering. Someone on the forum suggested a few methods for the Visual studio installer, but since I had been using another software, a certain...
0
1555
by: pnr | last post by:
I transferred my database to a new computer. I can open it in 2003 Access, but am keeping it in the 2000 version until I get it working correctly. I have dozens of Word documents where I use various Access queries as my datasource. Now when I try to mail merge in Word (for some, not all, of my documents.) Word mail merge message may say it can't find the data source. So it gives me a data selection box and I choose my transferred...
4
3825
by: Shaldaman | last post by:
Hi, We're running Office 2000 at our organization. We've been using an Access database that is shared on the network; we have forms in the database in which when we click on a button, data is retrieved using a query and exported to a Mail Merge Word document. It has worked fine for years. Recently we purchased a bunch of new computers on which we installed Office 2000. On these new computers, when we open the Access forms and click the...
1
1541
by: AccessHunter | last post by:
Please help... I have 2 queries with the same type of information, Query1 has the columns - CaseID, PlaceDate, MailDate, Before, After Query2 also has the same columns, but Query1.CaseID does not match Query2.CaseID. CaseID is what I use to join the queries. What I am trying to do is merge both Queries and make them into one Query. Please help
1
1286
by: Rajesshram | last post by:
I have two table designed in Access, I have two queries to populate data. I used the UNION option to merge the queries but I need the result as colums and not row wise. Any Idea how i should proceed... The below query is working for two colums but If i need more than 2 with specific condition for each how do i do that... Please help SELECT EMPStatus.EmpID, Attendance.Status FROM EMPStatus, Attendance WHERE...
1
2575
by: rytsyd | last post by:
Hi, I already have a working code where I have an application that queries to SQL then exports it to excel. It also merge cells that have the same value. The only problem I have is that it takes too long to merge the cells since it needs check each cell per column and row. Below is my sample code: Dim MergeCellRange As Excel.Range Dim rowcellcount As Integer Dim colcellcount As Integer ...
0
10224
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11652
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11261
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11436
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10745
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6271
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4595
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.