473,385 Members | 2,044 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,385 software developers and data experts.

merge two queries into one

232 100+
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 2040
code green
1,726 Expert 1GB
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
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...
2
by: Philippe Bouffaut | last post by:
Hi all, Here is my problem, I have 3 tables : People ------------- IDPeople Firstname Lastname
6
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...
8
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...
0
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...
0
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...
4
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...
1
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...
1
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...
1
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.