Chapter 48 – Specifying Join Ranges for QUERY

The two QUERY’s were destroyed by Saito, turning into chunks of metal. Since it was an individual that couldn’t be processed due to errors, we left it alone and gathered back at our original position.

“Saito-san, that grenade from earlier. Why did you have something that dangerous?”

“Oh, you mean that? Here.”

Saito opened his bag and offered to give us a grenade as casually as handing out oranges.

“No, I think I’ll refrain.”

I was a little worried, but decided against it for today. It was true that it might let me survive today’s crises, but it was also scary. I shudder to think that these were all in the same car today. Did he always bring them along? I needed hazard pay.

“Umm.”

Inoue interjected.

“Oh, do you want one? A grenade?”

“I guess I’ll take one. No, wait, I think it would be better to talk about joins now.”

“Yeah, that’s right. Go for it.”

Placing the grenade she recieved into her bag, Inoue began to explain.

“The reason why two QUERY’s appeared from the one cell earlier was because two data ranges were combined.”

=QUERY({Data Range 1; Data Range 2}, Query)

“It’s written like this. Two or more data ranges can be combined by separating them with a semicolon (;). Of course, it doesn’t make sense unless the columns are in the same order for each.”

“Do the column names have to match completely?”

“No, actually, when you use join, the headers can’t be read. So whether you use the [Headers] option or not, the headings will not be recognised and will be treated as data rows.”

That certainly seemed it would be a problem if the notation in the headers changed.

“By the way, you also need to be careful with how you write your queries. You remember that columns are written using their letters in queries, right? For joins, you need to write them as Col1, Col2, etc from the left.”

A:Name         B:Gender   C:Age

—————-   ————- ———-

Takahashi      Male           27

Saito               Male           43

“For example, if we use this data, the other set of data has to look like this.”

D:Name         E:Gender   F:Age

—————-   ————- ———-

Inoue              Female       17

“I see. You’re right, this doesn’t allow for alphabetical designations.”

As Inoue finished her explanation, the two QUERY’s that had been immobilised disappeared. Then, two new QUERY’s appeared from the same cell.

[Previous Chapter] [Table of Contents] [Next Chapter]

Leave a Reply

Your email address will not be published. Required fields are marked *