here's what i want to have happen:
results_table:
id, val1, val2
1, 2, 1
2, 1, 0
3, 1, 0
4, 1, 1
the first query (make-table) generates the following ("" AS val2):
id, val1, val2
1, 2, 0
2, 1, 0
3, 1, 0
the second query (it's an append query) results in the following:
id, val1, val2
1, 2, 0
2, 1, 0
3, 1, 0
1, 0, 1
4, 0, 1
how do i achieve what i want in the results_table? 3 2028
I thought at first that Result is supposed to have a number in place of
a zero from a superposition of tables 1 and 2, sort of like an "OR"
operation for each ID. But then you have a 4,1,1 in the result. I am
lost - how do you get that? There is no 4,1,0 record anywhere.
In other words, how the Result is achieved?
Pavel
david liu wrote: here's what i want to have happen:
results_table: id, val1, val2 1, 2, 1 2, 1, 0 3, 1, 0 4, 1, 1
the first query (make-table) generates the following ("" AS val2):
id, val1, val2 1, 2, 0 2, 1, 0 3, 1, 0
the second query (it's an append query) results in the following:
id, val1, val2 1, 2, 0 2, 1, 0 3, 1, 0 1, 0, 1 4, 0, 1
how do i achieve what i want in the results_table?
Pavel Romashkin <pa*************@hotmail.com> wrote in message news:<40***************@hotmail.com>... I thought at first that Result is supposed to have a number in place of a zero from a superposition of tables 1 and 2, sort of like an "OR" operation for each ID. But then you have a 4,1,1 in the result. I am lost - how do you get that? There is no 4,1,0 record anywhere. In other words, how the Result is achieved?
oops. typo on row id=4. it should be 4, 0, 1.
Pavel
david liu wrote: here's what i want to have happen:
results_table: id, val1, val2 1, 2, 1 2, 1, 0 3, 1, 0 4, 1, 1
the first query (make-table) generates the following ("" AS val2):
id, val1, val2 1, 2, 0 2, 1, 0 3, 1, 0
the second query (it's an append query) results in the following:
id, val1, val2 1, 2, 0 2, 1, 0 3, 1, 0 1, 0, 1 4, 0, 1
how do i achieve what i want in the results_table?
SELECT ID, max(val1), max(val2) FROM (SELECT * FROM qry1 UNION SELECT *
FROM qry2) GROUP BY ID
should produce the result you show in the example. You need to figure
out what you want to happen if you have source records like
1, 2, 1
1, 1, 3
which is not part of your example.
Pavel
david liu wrote: Pavel Romashkin <pa*************@hotmail.com> wrote in message news:<40***************@hotmail.com>... I thought at first that Result is supposed to have a number in place of a zero from a superposition of tables 1 and 2, sort of like an "OR" operation for each ID. But then you have a 4,1,1 in the result. I am lost - how do you get that? There is no 4,1,0 record anywhere. In other words, how the Result is achieved?
oops. typo on row id=4. it should be 4, 0, 1.
Pavel
david liu wrote: here's what i want to have happen:
results_table: id, val1, val2 1, 2, 1 2, 1, 0 3, 1, 0 4, 1, 1
the first query (make-table) generates the following ("" AS val2):
id, val1, val2 1, 2, 0 2, 1, 0 3, 1, 0
the second query (it's an append query) results in the following:
id, val1, val2 1, 2, 0 2, 1, 0 3, 1, 0 1, 0, 1 4, 0, 1
how do i achieve what i want in the results_table?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Paradigm |
last post by:
I am using Access 2K as a front end to a MYSQL database.
I am trying to run a Union query on the MYSQL database. The query is (much
simplified)
SELECT as ID from faxdata UNION
SELECT as ID ...
|
by: Umar Farooq |
last post by:
Hello all,
Please bear with the long explanation of my scenario.
As I'm relatively new to the query world, I like to write my queries
using the visual toos such as the "View" option in SQL...
|
by: James Foreman |
last post by:
I've got lots of different tables, each pertaining to a different
marketing campaign.
I have another table that stores the name & schema of each of these
tables, together with other information...
|
by: Pete |
last post by:
Before I get started with the question, does anyone have a (single)
good book recommendation for database design? Not an Access-specific
book, but something geared toward helping me figure out...
|
by: ravi |
last post by:
I have created the following interest to calculate the interest for
the following currency pairs. I have tried to combine them in macros
using conditions but the next query that is run in the macro...
|
by: snOOp |
last post by:
I am trying to combine the data from two similar tables into one
query, but I need for all of the records from both tables to show up
and I want the ones that have matching 'emplid' to be combined...
|
by: JBoeker |
last post by:
Hello,
I have 3 tables in my mdb file, one contains a list of definitions, one
is a list physical items, and one is a list overrides. Normally my
query will join the definition physical item...
|
by: comp_databases_ms-sqlserver |
last post by:
This post is related to SQL server 2000 and SQL Server 2005 all
editions.
Many of my stored procedures create temporary tables in the code. I
want to find a way to find the query plan for these...
|
by: dreaken667 |
last post by:
I have a MySQL database containing 16 tables of data. Each table has a different number of columns and there are few common field names accross tables. I do have one master table with which I connect...
|
by: sillyr |
last post by:
Hi - I use Access 2007. I have two tables linked by ID. I created a query to combine the two tables. My problem is that in the query my Species_Code is text, but I need it to display the number...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
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: 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,...
| |