RE: How to combine two queries into one?
- From: Dawn <Dawn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 15 May 2008 18:58:01 -0700
Dale,
First I’d like to thank for your patient explanation. I have some further
questions to ask ,hope you can rely with the same patience,thanks.
1. For each person there are several records in the table 1, but for every
table1.name its table1.city is unique, in fact table1.salary refers to
account balance. So the primary key in table1 is account no., but is ignored
in both two queries. I group both by name and city ,because the field city is
going to be inner joined with table2.city and also because whether to be
grouped by either name or by two fields name and city duo to the exclusive
relation between name and city, the results are same, except the latter will
add a city field beside field name.
2. Before seeing your sql proposed, I never thought of to use “union”
function, thank you again to give me a new way of thinking. And I’v tried in
the sql view platform to put in your sql, it appeared not as I wanted,
because after running the query, it turned out with records not with unique
province, as I explained as above I supposed the results turned out with the
lists of provinces (ignoring grouped by city) and the total account balance
within the city.
3. because I am not familiar with the meaning of First("") as City, I
first omitted in the sql view platform, but while running it returned with
error, as long as I put the sentence in ,it runs well, can you explain the
sentence for me ,if it need explain the whole union query written in sql?
4.I am absolutely sorry as to beg you to write another query for me in sql,
according to the information above.
Many thanks.
Dawn
.
- References:
- How to combine two queries into one?
- From: Dawn
- RE: How to combine two queries into one?
- From: Dale Fye
- How to combine two queries into one?
- Prev by Date: Need your Help - Average
- Next by Date: Re: Classified by segment
- Previous by thread: RE: How to combine two queries into one?
- Next by thread: Classified by segment
- Index(es):
Relevant Pages
|