Announcing Multiple Columns

A sign marks the COVID-19 testing site at the old J.C. Penney store at FairOaks Mall in Columbus, Ind., Tuesday, Sept. 22, 2020. Mike Wolanin | The Republic
Multiple

How do I merge multiple (3+) columns into one, where there are blank or #N/A cells involved? I can use the Two-Into-One article just fine for handling blanks (or changing isblank to isna to handle #N/A values), but I haven't been able to get it to handle 3+ columns even after trying to combine the parsing of both articles together. Lines 97-98 set rngSrc, the column of data from our Source Worksheet. Since we know the column number (lngIdx, as we’re looping through the columns) as well as the last-occupied row on the Source Worksheet (lngLastSrcRowNum), we can create this Range using these cells.

Staff Reports

Multiple

INDIANAPOLIS — The Indiana Department of Health said 6,045 additional Hoosiers have been diagnosed with COVID-19 through testing at state and private laboratories. That brings to 558,560 the number of Indiana residents now known to have had the novel coronavirus following corrections to the previous day’s dashboard.

A total of 8,595 Hoosiers are confirmed to have died from COVID-19, an increase of 75 from the previous day. Another 371 probable deaths have been reported based on clinical diagnoses in patients for whom no positive test is on record. Deaths are reported based on when data are received by the state and occurred over multiple days.

To date, 2,738,914 unique individuals have been tested in Indiana, up from 2,724,389 on Friday. A total of 6,061,499 tests, including repeat tests for unique individuals, have been reported to the state Department of Health since Feb. 26.

Bartholomew County reported 5,945 positive tests (up 71) with 91 deaths (up two) as of Saturday.

Surrounding counties reported:

Jackson County: 3,995 positive cases (up 32) with 45 deaths (no change).

Jennings County: 1,819 positive cases (up 23) with 34 deaths (no change).

Decatur County: 2,302 positive cases (up 24) with 80 deaths (up one).

Shelby County: 3,786 positive cases (up 48) with 75 deaths (no change).

Johnson County: 13,592 positive cases (up 237) with 268 deaths (up seven).

Brown County: 815 positive cases (up nine) with 28 deaths (no change).

To find testing sites around the state, including a site at the FairOaks Mall in Columbus, visit www.coronavirus.in.gov and click on the COVID-19 testing information link.

Announcing Multiple ColumnsAnnouncing Multiple Columns

Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial.

You don't have to retrieve all the information from a table. You can retrieve only the information you want from the columns you want and filter out the rest.

Announcing Multiple Columns Meaning

SQL Used

Retrieving a single column:

Examples:

Retrieving multiple columns:

Examples:

See all of the SQL used in SQL Basics in the SQL Basics Cheat Sheet.

In the previous video we used the selectstar from table query to retrieve all 0:00
information in a table, but you may notwant to bring back all the information. 0:05
Often you want a smallsubset of information. 0:10
This can be particularly helpful ifyou don't want to bring back sensitive 0:13
Like the addresses or dates of birth. 0:18
Let's take a look at some simpleways to retrieve only some 0:21
Let's start with all the informationfrom the patrons table. 0:26
The asterisk, or star, is short hand forall of the column named in the table. 0:34
Now, what if I wanted to retrieve onlythe emails from our patrons table? 0:39
We still want to select somethingfrom our patrons table. 0:44
All we need to do is change the asterisk,remember? 0:50
We can replace it withthe column name we want. 0:57
As you can see this selects allthe emails from our patrons table. 1:05
What if we wanted all the firstnames in our patrons table. 1:12
You just to write the name of the firstname column first underscore name 1:17
Okay, let's change that back. 1:27
Having either all columns or a singlecolumn returned back has limited utility. 1:33
Remember, the power of SQL is that youcan retrieve any subset of information 1:38
from a table without beingdestructive to the underlying data. 1:43
Nothing is deleted,it's just presented differently. 1:47
Let's say I wanted to send out a librarynewsletter talking about the new book 1:52
How do I go about retrievingboth the first name and 1:58
Announcing Multiple Columns
In other words, 2:02
how do I select two columns of datafrom the database with one query? 2:03
SQL makes this kind oftask pretty easy on us. 2:08
each column I want witha comma in the SQL query. 2:13
The great thing is that I can changethe ordering of the columns how I see fit. 2:19
Since the recap,the area between the SELECT and 2:34
the FROM keywords is the columns youwant to get the information from. 2:37
SELECT * FROM patrons is a lot shorterthan including all of the column names. 2:42
You're a better person than me if youcan remember all the column names. 2:46

Announcing Multiple Columns Definition

Let's do some challenges tosolidify what we've learned here. 2:49

Announcing Multiple Columns Images

You need to sign up for Treehouse in order to download course files.