Hello everyone,
1/ I want to do a sql query that transform the result from row to column like it's shown in the picture. Is it possible ?
2/ How can I update the second table with the first one ?
Hello everyone,
1/ I want to do a sql query that transform the result from row to column like it's shown in the picture. Is it possible ?
2/ How can I update the second table with the first one ?
You could use in the query
select 'EH545WL' as name, EH545WL as value from car union select 'FJ281TJ' as name, FJ281TJ as value from car;
If you use this query, you could get the result you want. Thank you
There are several ways that you can transform this data.
Create Table:
CREATE TABLE yourTable([EH545WL] varchar(10), [FJ281TJ] varchar(10));
INSERT INTO yourTable
VALUES
(0,0);
Unpivot table:
SELECT ID,Value
FROM yourTable
UNPIVOT (value for ID in ([EH545WL],[FJ281TJ])) up