Let's say we wanted to put the same data into multiple rows like so.
Column names for this example:
Monday, Tuesday, Wednesday, Thursday, Friday
INSERT INTO sample
VALUES ('long string')
This is an example of what I mean so the same value is in each column
Monday | Tuesday | Wednesday | Thursday | Friday
long string | long string | long string | long string | long string
I want that long string within all columns, is there a way to do this without using multiple insert statements? OR is there a way to create a CTE that could automate this to make it easier?
You have to list all the values:
You don't specify the database, but you could use a subquery to reduce the size of the query: