SQL

Hierarchy:

Categories

Tags:

Updated 2023-08-07

VALUES

VALUES lets you create an ad-hoc list.

SELECT * FROM (VALUES (1, 'A'), (2, 'b'), (3, 'C')) AS foo (num, title)Code language: SQL (Structured Query Language) (sql)

returns:

numtitle
1A
2b
3C

It is nice to be able to make a VALUES list to pass in a list you want to filter by with a readable value and an ID for joining, then LEFT JOIN with the other tables to pull in the data you are interested in.

Docs for VALUES:


Local import on homebrew mysql

$ mysql -u root DBNAME < sqlfilename.sql

Though if you are using WordPress and wp-cli, it is easier to do wp db import FILEPATH


Splitting a large .sql dump into multiple files

Use https://philiplb.de/sqldumpsplitter3/