I need some help with some basic, i suppose, mysql.
given three columns such as the ones below:
[Events Counts Date
play 2 2017/06/05
pause 3 2017/06/05
first quartile 4 2017/06/05
play 10 2017/06/06
pause 12 2017/06/06][1]
How can I split the column event into new columns such Play column, pause columns and so on, having each of these new columns the relative data coming from the initial table?
Below you can find the link of what the resulting table should be looking like
Thanks
Related
I am new to MySQL, currently I've been trying to create a column in a table that contains the total of payment an individual has to pay. For references, the first picture is how I want the tables to look like (in the big picture).
What i want is that in the column of total_to_pay, it automatically sums up the value of price from Mobile_Subscription, value of price from TV_Subscription and value of payment_from_past from History. So I want it to basically look something like this:
I want to know if such thing is possible and if not how can i make something similar?
I searched on Google this problem but all I could find was how to sum all values from 2 different columns, when what I wanted is to sum 2 (or 3) specific values from 2 different column from 2 different tables.
Can any body tell me if the following is possible in one SQL table.
Code Allocation Table
Basically when a new record is created, by populating the first 3 columns, the reference in column 4 is then generated, but the number is specific to the Project and Type fields and increments by 1 each time (multiple UID in one Table). So if some one generates another TEQ Document against Project 21345, for example, it remember the last number was 3 and allocates 4, as shown in the picture.
Many thanks in advance.
I have a table that I use for statistical purposes.
Its columns are id and 1,2,3,..,31 and pivot.
This table gives the number of views on each day for the last 31 days.
1 gives the number of views for yesterday.
14 gives the number of views for 14 days ago.
etc ...
(pivot is just used to calculate the number of views)
I would use a cron job every day to update this table, but how would I go about "shifting" all the values to the side ( value column 15 would become value column 16; new value for column 1; delete value for column 31)
Define a table with only two columns — "date" and "views"
INSERT a new row in the table with the view count for that day when the CRON job runs
Modify your application query to read through this new table over a custom date range, which could be 31 days or anything else either — please have a look at this link to get an idea:
MySQL Query - Records between Today and Last 30 Days
Not really sure how pivot is being used here. However, I'm almost certain that if you're using it to store the sum of the views, it could as well be computed by using SUM() or GROUP BY without having to need a separate column in the table
As far as data archival / removal is concerned, your daily CRON job could be modified to include a DELETE query (as the last step) which cleans up records older than a certain date. Again, you could use the link above to get your "target" date
.
I apologise that this might sound like a little too long a solution to what you've asked for. However, I feel, this approach should help you organise and maintain the table in question in a better way.
I am a newbie with access and I am trying to import records into several tables from an excel file. Each row in excel has different number of columns, but the good thing is column A is able to help me to identify what records need to go to my different tables.
Sample table
As you can see in the picture, Row 1 Column A has the value of "H", which would indicate that this record needs to go to the "H" table. Then the next few rows have a value of "R" in Column A which indicates that these records should go to the "R" table, and so on and so forth. However, the number of records to be imported into each table will vary all the time. Like the sample above rows 2 through 10 belong to the table R, but the next import may have only 5 or 20 records.
Currently I am using a temporary table and using an append query for each table but I am wondering if there is an easier way via VBA or other method that could be faster and more efficient.
Thanks!
The way you are doing it now may be the best way. An alternative would be to do this in two steps:
1) split your column A, and parse out to different sheets (or different workbooks).
http://www.rondebruin.nl/win/s3/win006.htm
2) load those different sheets (or workbooks) into different tables.
http://www.accessmvp.com/KDSnell/EXCEL_Import.htm#ImpAllWktsSepTbl
http://www.accessmvp.com/KDSnell/EXCEL_Import.htm#ImpFldWrkFiles
i have ms access query with several fields and columns, some of the data in the tables that I query shows up multiple times. I would Like to eliminate duplicates based on 4 columns - if this 4 columns are identical in more rows I would like them to be displayed only one time. Is this possible?
See attached example:
the first 2 entries should be consolidated into 1 entry.
Br,
I found a simple solution for this - What I needed to do is to change the property in the Query Design "Unique Values: Yes"