Advertisement

08.17.2008 at 04:53PM PDT, ID: 23655138
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

How do i select records - with a where clause that is limiting my query results.

Asked by SaxonNZ in SQL Query Syntax, Informix Database

Tags:

Hello

I have written a query that pulls out sales information across whatever date range i wish. The issue comes when i try to match up a barcode to the product code, it seems that not every product that has been sold had a barcode.

So when i run my query with a where clause stating
where baprodno = pmprodno it is limiting my results to all the products sold that have a barcode, and ignoring the ones that dont. How can i select all the records showing the products and the barcode for those products that have one, and the others that dont.

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
select unique sphprodno, spdqty, spddate, spdvalue,
 pmprodno, pmunits, pmgrp, pmsubgrp,
 pmdesc
from salesbyperiod, product
  where sphprodno = pmprodno
  and spddate >= "01/07/2008"
  and spddate <= "31/07/2008"
  and sphwhseno = "STD"
group by 1,2,3,4,5,6,7,8,9
into temp a1;
 
select babarcode, baprodno
from barcode, a1
where baprodno = pmprodno
group by 1,2
into temp a2;
 
unload to "/test/prodextract.txt"
select unique pmprodno, pmdesc, pmunits, pmgrp, pmsubgrp, babarcode,
sum(spdqty) quantity, sum(spdvalue) sales
from a1, a2
where baprodno = pmprodno
group by 1,2,3,4,5,6
[+][-]08.17.2008 at 06:26PM PDT, ID: 22248959

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Informix Database
Tags: SQL - Informix
Sign Up Now!
Solution Provided By: llman
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.17.2008 at 07:08PM PDT, ID: 22249068

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628