I have to design a Google Form wherein users can provide multiple responses to a particular question. The number of responses can vary from user to user and does not have a fixed upper limit (Would mostly never go above 20 but still can't put a number on it). For example:
Response 1
Name: John
Age: 26
Answer: Apple
Banana
Response 2
Name: Mike
Age: 28
Answer: Guava
Mango
Orange
Now, this is how I want this data to look in the spreadsheet:
Name Age Answer
John 26 Apple
John 26 Banana
Mike 28 Guava
Mike 28 Mango
Mike 28 Orange
How to achieve this? Any help will be appreciated.
Related
I have some text data in a column similar to this in MySQL 8.0.30:
Id
Weights
1
James Brown 10-10 John Doe 12-9 Sue Smith 9-9 Dick Turpin 9-12
2
Some Other 9-1 Example Name 8-13
There could be any number of name/weight combinations in the column. I want to pull these out into separate rows like so
Id
Weights
1
James Brown 10-10
1
John Doe 12-9
1
Sue Smith 9-9
1
Dick Turpin 9-12
2
Some Other 9-1
2
Example Name 8-13
I've tried using the regex_substr to no avail as I could only get it to return a single match. How could I go about doing this?
Suppose I have a table like this:
name position zipcode
-------------------------
Gary Gm 12345
Rob VP 54321
John Manager 1234
After 20 minutes some rows were added in the source and now the table looks like
name position zipcode
------------------------
Gary Gm 12345
Rob VP 54321
John Manager 1234
Chris Director 5478
Kane VP 9999
So Kane and Chris were added after 20 minutes in the source, and there is no date time field to identify on which day the rows were added, I just wanted to know if there are any functions to identify the newly added rows in the table in SQL Server 2014?
First time Poster here so I appoligize about the formatting and am really novice at sql, but this has me stumped. That and I am using 2016 MS Access's SQL as well.
I have a table and I want to select only the names of the people who have fulfilled all the requirements.
Table Chore
ID Name Chore Done
1 Joe Sweep Yes
2 Joe Cook Yes
3 Joe Dust Yes
4 Bill Vacuum No
5 Bill Dust Yes
6 Carrie Bathroom Yes
7 John Cook No
8 John Beds No
9 John Laundry Yes
10 Mary Laundry No
11 Mary Sweep No
12 Cindy Car Yes
13 Cindy Garden Yes
In this case, only Joe, Carrie and Cindy's names should be returned because under their name, they finished all their chores.
Help please and thanks in advance!
You can use not in
select name from my_table
where name not in (select name from my_table where chore_done ='No');
You could check the value of max(done), like
select
name
from
my_table
group by name
having max(done) = -1
In Access, Yes/True is -1, No/False is 0, so max(done) is Yes
I have a table:
id owner ex_id
1 jack -
2 joe -
3 charlie 1
4 bill 3
5 helen 2
6 jack 5
7 anna 4
8 Kurt 7
It is possible to have in a select sentence (not a program, just sql) something like "get all the ex_id´s from id 7":
id 7: anna, bill, charlie, jack
(7 point to 4, 4 point to 3, 3 point to 1, 1 dont have property so it ends)
TIA
It is not possible to perform such a hierarchical query using pure SQL in MySQL, sorry to say.
Oracle can do it. http://docs.oracle.com/cd/B19306_01/server.102/b14200/queries003.htm But that's not what you asked.
I have a table
user_name id status calls
===========================================
apple 21 cars 67
apple 21 bikes 85
apple 21 skates 6
apple 21 pajs 56
orange 34 bikes 9
orange 34 disks 3
orange 34 cars 21
orange 34 pajs 76
I want to add up all the calls for status's that are cars, bikes and skates only and for each user_name. I have experminted with SUM but after several hours of late night, earnest attempts its pretty clear to me that this is going to require more than that. Can anyone point me in the right direction please?
My Table
select user_name, status, sum(calls) as calls
from table
where status in ('cars', 'bikes', 'skates')
group by user_name, status