https://sql.sh/cours/jointures/inner-join
()
| 11 | |
| 12 | // https://sql.sh/cours/jointures/inner-join |
| 13 | func sampleForJoin() (*datatable.DataTable, *datatable.DataTable) { |
| 14 | customers := datatable.New("Customers") |
| 15 | customers.AddColumn("id", datatable.Int) |
| 16 | customers.AddColumn("prenom", datatable.String) |
| 17 | customers.AddColumn("nom", datatable.String) |
| 18 | customers.AddColumn("email", datatable.String) |
| 19 | customers.AddColumn("ville", datatable.String) |
| 20 | // customers.AddColumn("concat", datatable.String, datatable.Expr("CONCAT(`prenom`,`nom`)")) |
| 21 | customers.AppendRow(1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris") |
| 22 | customers.AppendRow(2, "Esmée", "Lefort", "esmee.lefort@example.com", "Lyon") |
| 23 | customers.AppendRow(3, "Marine", "Prevost", "m.prevost@example.com", "Lille") |
| 24 | customers.AppendRow(4, "Luc", "Rolland", "lucrolland@example.com", "Marseille") |
| 25 | |
| 26 | orders := datatable.New("Orders") |
| 27 | orders.AddColumn("user_id", datatable.Int, datatable.Values(1, 1, 2, 3, 5)) |
| 28 | orders.AddColumn("date_achat", datatable.Time, datatable.Values("2013-01-23", "2013-02-14", "2013-02-17", "2013-02-21", "2013-03-02")) |
| 29 | orders.AddColumn("num_facture", datatable.String, datatable.Values("A00103", "A00104", "A00105", "A00106", "A00107")) |
| 30 | orders.AddColumn("prix_total", datatable.Float64, datatable.Values(203.14, 124.00, 149.45, 235.35, 47.58)) |
| 31 | |
| 32 | return customers, orders |
| 33 | } |
| 34 | |
| 35 | func TestJoinOn(t *testing.T) { |
| 36 | on := datatable.On("[customers].[id]") |
no test coverage detected