This topic is locked
[SOLVED]

How can I change the contents of a table?

7/14/2024 2:59:15 AM
PHPRunner General questions
J
Jan author

Hi everyone, I have a table, see the picture below

img alt

you can see that in this table the name "name1" is present 3 times and the name "name2" is present 2 times

I want to transform the table, see photo below

img alt

What code do you need to transform the table so that the duplicate names are removed and the numbers are adjusted?
Thanks for your help.

C
Chris Whitehead 7/14/2024

In the query section, you'll need to make the sql a little like this

select Nummer, SUM( Aantal) as Aantal FROM tablename GROUP BY Nummber

You'd also have to update the delete event so it deletes all the records with the same Nummer

J
Jan author 7/14/2024

thanks for the valuable tip !

F
FR 7/15/2024

Chris - you beat me to it. Was just coming to post here about SQL SUM and GROUP BY.

I - if you are going to build database centric web apps, you want to spend some time getting familiar with SQL basics.

Suggested reading: https://www.w3schools.com/sql/

C
Chris Whitehead 7/15/2024

@FR It's all about getting the answers in early to get the XL points, we do get points don't we?

That would be a good idea, put answers in and get points which we can swap for Xlinesoft plugins.