mysql – Combining multiple rows in a single row with multiple columns

I am trying to do a manual query for the postmeta WordPress table that would combine two postmeta types in one with several columns by post_id.

This is the structure of the table:

-------------------------------------------------- ------
meta_id | post_id | meta_key | meta_value
1 | 100 | _wp_attachment_metadata | a: 6: {s: 5: "wide"}
2 | 100 | _thumbnail_id | 2. 3
`

This is the result I am trying to achieve:

-------------------------------------------------- ------
post_id | _wp_attachment_metadata | _the Commission_
100 | a: 6: {s: 5: "wide"} | 2. 3

sharepoint designer – How do I create rows and columns in jQuery after extracting data from a list of shared points?

I created an accordion in JavaScript that contains 7 categories, I'm also extracting data from a list of shared points and I filtered the elements by category. After filtering the elements by their category and adding them to their respective category panel, I want to create 4 columns and the necessary rows with the elements extracted from the list. The desired final result is attached.
enter the description of the image here

This is the code that I have developed so far.

$ (document) .ready (function () {
$ .ajax ({
url: "http: // bc-net / _api / web / lists / GetByTitle (& # 39; specialDiscounts & # 39;) / items",
method: & # 39; GET & # 39 ;,
headers: {
& # 39; Accept & # 39 ;: & # 39; application / json; odata = verbose & # 39;
}
success: function (data) {
var items = data.d.results;
console.log (elements);

var auto = $ (& # 39; # automotive & # 39;);
var entertainment = $ (& # 39; # entertainment & # 39;);
var healthBeauty = $ (& # 39; # healthBeauty & # 39;);
var travel = $ (& # 39; # travel & # 39;);
var electronics = $ (& # 39; # electronics & # 39;);
var services = $ (& # 39; # services & # 39;);
housing var = $ (& # 39; # housing & # 39;);


for (var j = 0; j <items.length; j ++) {

var panelsContent = & # 39;
& # 39; + & # 39;
& # 39; + & # 39;
& # 39; + & # 39;

& # 39; + elements[j].Title + & # 39;

& # 39; + elements[j].Description + & # 39;

& # 39; // branching logic, // add the

in different places based on // different possible values ​​of Category switch (elements[j].Category) { case & # 39; Automotive & # 39 ;: auto.append (panelsContent); break; case & entertainment & # 39 ;: entertainment.append (panelsContent); break; Case & # 39; Health & Beauty & # 39; healthBeauty.append (panelsContent); break; case & # 39; trip & # 39 ;: travel.append (panelsContent); break; Case & # 39; Electronics & # 39 ;: electronics.apend (panelsContent); break; case & # 39; Services & # 39; services.append (panelsContent); break; case & # 39; Housing & # 39; vivienda.apend (panelsContent); break; default: break; } } } error: function (data) { alert (& # 39; Error: & # 39; + data); } }) // End of service icons // End of service icons }) // Finish the list function

This is a piece of HTML.


Grab only non-empty cells in a range of rows for each row

I have a survey that sends answers to a Google sheet. The raw data that is inserted is untidy, so I have another sheet that processes the incoming raw data.

One of the things I must do is: from a range of columns in a row, pull the non-empty cells, and do it automatically with every new response you receive.

This is what I found to work with a single row, but I can not figure out how it automatically applies to the entire column:

= transposition (QUERY (unique (transpose ({& # 39; Raw data & # 39;! AL3: AY3, & # 39; Raw data & # 39 ;! AL3: AY3}))
"SELECT COL1 WHERE COL1 <> & # 39; & # 39; ORDENED BY COL1 LIMIT ASC 8", 0))

Because the survey will insert rows, it will end up adjusting any cell reference in my sheet & # 39; Processed Data & # 39 ;, so I've been trying to use Arrayormula unsuccessfully

In addition, the range of columns will be more than 400 (school options), so writing individual column names would probably be unfeasible.

Here is a link to the spreadsheet

The emission column begins in column O

Background: In the survey, a respondent can select several schools up to a maximum of 8 from a selection of more than 400 schools. On the sheet & # 39; Raw Data & # 39 ;, each school option is represented by a column.

Hopefully all that makes sense. Any help would be much appreciated, I've been stuck in this for a while!

How to prevent UPDATE of existing rows / records but allow INSERT using the PostgreSQL trigger?

How can I prevent UPDATE in any record in a given table, but allow INSERT, I have already created a trigger that prevents the update but I found that it also prevents INSERT.

mysql – Error updating rows in a table and its engine

Well, I have a small problem when it comes to updating the lines of a certain table, I'm trying to transfer the engine to InnoDB, and the date_install column generates errors due to zero dates.
In the case, I used the following query:

"update` glpidb`.`glpi_computers_softwareversions` set` date_install` = & # 39; 2019-01-01 & # 39; where` date_install` = & # 39; 0000-00-00 & # 39 ;;

the error that returns me is

ERROR 1292 (22007): Incorrect date value: & # 39; 0000-00-00 & # 39; for column & # 39; date_install & # 39; in row 1

As previously reported, I am also trying to pass the table to InnoDB.

Query update for InnoDB

change table `glpidb`.`glpi_computers_softwareversions` Engine = InnoDB;

* The error that occurs to me when executing the update query to InnoDB

ERROR 1292 (22007): Incorrect date value: & # 39; 0000-00-00 & # 39; for column & # 39; date_install & # 39; in a row 5102

python 3.x – Iterate through groups of rows with different indexed values

The data looks like this:

Data = {& # 39; group_id: [‘1′,’1′,’1′,’1′,’2′,’2′,’2’],
& # 39; fountain & # 39; [‘Twitter’, ‘Instagram’, ‘Twitter’, ‘Facebook’, ‘Facebook’, ‘Twitter’, ‘Instagram’, ‘Facebook’]
& # 39; Gravity & # 39; [4,2,7,4,8,9,3,5]}

I need:

1) Take the first row of the Severity Code of each group
2) Obtain the absolute value of all the rows (difference) of the identified severity code of each group (from # 1). Example: Group severity code 1 (4) … first row diff = 0; second row diff = 2; third row diff = 3; The same for group 2.
3) In each group, find the closest neighbor of each source, up to the severity of the first row.

I have identified the first row and indexed the severity code. When iterating, the code only uses the last indexed severity code to calculate the difference.

df = pd.DataFrame (Data)
first_row = b.groupby (['group_id']).First()
for the row in first1.itertuples (index = True, name = & # 39; Pandas & # 39;):
value = getattr (row, & # 39; Severity & # 39;)
df['dif'] = (df['Severity'] - value) .abs ()

I hope the output is in a Dataframe with a column & # 39; dif & # 39; added I can extract nearest neighbors in each group for each source where True. Repeat the process: extract the rows where True and pass the False to find additional rows with a new severity of the first row. Repeat again until there are no rows, or all rows are False.

Google Sheets: How can I group by a column to join values ​​in several rows?

Let's say I have a survey of people in teams and what fruits they like:

User | Team | Fruits
----------------------
Dave | Mina Plátano, apple
Steve | Orange Apple Mine
Matt | Yours | Banana

This would have been populated by a Google form. I'm looking to transform this into:

Team | Fruits
--------------
Banana mine, apple, orange
Yours | Banana

Then you might know that two teams like bananas, while a team also likes apples and oranges. I've been studying a combination of QUERY and JOIN but I'm missing a lot.

In a cell, I have done. = UNIQUE (& # 39; Answers in the rough & # 39 ;! C2: C105), which brings me to all the unique teams.

In another, I have done it. = UNIR (",", "Unprocessed responses" E2, & # 39; Unprocessed responses & # 39; E3) It gives me what I want manually (without the unique value bits yet, so I would see apples twice).

In my third test, I made = QUESTION (& # 39; Answers in the rough & # 39 ;! C2: E105, "SELECT E where C = & # 39; Mine & # 39;"), which broadcasts the answer in two rows

Note that do corresponds to Teams Y my corresponds to Fruits on my real sheet.

To update

= JOIN (",", QUERY (& # 39; Unprocessed Answers & # 39 ;! C2: E105, "SELECT E where C = & # 39; Mine & # 39;")) It's almost what I want. I'm just not sure how to do Mine become a pointer A1 inside a different sheet that Raw answers how is it in Sheet2. So I need to make the cell just unique values ​​yet.

Update 2
= JOIN (",", QUERY (& # 39; Unprocessed responses & # 39 ;! C2: E105, "SELECT E where C = & # 39;" & $ A1 & "& # 39;)) It's working, I just need to figure out unique values ​​now 🙂

excel – Python: combining two rows with pandas read_excel

I'm reading an Excel file using Pandas and I feel there has to be a better way to handle the way I create column names. This is something like the Excel file I am reading:

                                                                1 2 # & # 39; 1 & # 39; merges into the two cells above & # 39; a & # 39; and & # 39; b & # 39; b & # 39;
Date a b c d # equally for & # 39; 2 & # 39 ;. Unlike & # 39; focused on the selection & # 39;
1 January-19 100 200 300 400
2 1-Feb-19 101 201 301 401
3 1-Mar-19 102 202 302 402

I want you to merge the columns & # 39 ;, & # 39; b & # 39 ;, & # 39; c & # 39; and & # 39; & # 39; d with the columns & # 39; 1 & # 39; and & # 39; 2 & # 39; about them, so I'm doing the following to make my headlines like me. want:

import pandas like pd
import json

xls = pd.ExcelFile (r & # 39; C:  Path_to  Excel_Pandas_Connector_Test.xls & # 39;)
df = pd.read_excel (xls, & # 39; Sheet1 & # 39 ;, header =[1]) # use row abcd as column names

# I just want the most recent data day, so I do the following
json_str = df[df.Date == df['Date'].max ()].to_json (orient = & # 39; records & # 39 ;, date_format = & # 39; iso & # 39;)

dat_data = json.loads (json_str)[0]

def clean_json ():
global data_data
data_data['1a']      = dat_data.pop (& # 39; a & # 39;)
data_data['1b']      = dat_data.pop (& # 39; b & # 39;)
data_data['2c']      = dat_data.pop (& # 39; c & # 39;)
data_data['2d']      = dat_data.pop (& # 39; d & # 39;)

clean_json ()

print (json.dumps (dat_data, indentation = 4))

My desired output is:

{
"Date": "2019-03-01T00: 00: 00.000Z",
"1a": 102,
"1b": 202,
"2c": 302,
"2d": 402
}

This works as written, but is there a built-in Pandas that I could have used to do the same?

Excel VBA Macro rows do not delete

I am new to creating macros for Excel. I'm trying to automatically delete a row if a cell does not contain a specific value or value. For testing purposes, I created a macro within a workbook and only then did I create a "hidden" personal workbook with all the macros that I intend to apply. This same code works exactly for the workbook with the macro created in it, but it will not work for the normal workbooks when executing the macro from the "hidden" file.

The macro of the "hidden" file is running, I have tried to generate an MsgBox on it and it appears.

Leaves ("Sheet1"). Activate

Dim r As Integer
For r = Sheet1.UsedRange.Rows.Count To 1 Step -1
If Cells (r, "M") = "Z04" O Cells (r, "M") = "" Then
Sheet1.Rows (r) .EntireRow.Delete
It will end if
Following

MySQL Search for rows where there is no matching column in two tables

year name configid
2019 dbk 12
2018 sbh 09

date status of mac
123 2017 pwp
121 2016 kpm

these are two tables, I need to find the configid of the first table when I must give mac entry of the second table. As in my database, configid is unique for each mac.