I have an order table with products and order lines.

Select "Order".Id, "Product".Id from "Order" join Product where Order.Id = 1 and Product.Id = 10 for json auto

will return

[{"Order": {"Id":1, "Product": [{"Id": "10"}] } }]

so far so good.

What is the easiest way to add the order lines and get the following json result:

[{"Order": {"Id":1, "Product": [{"Id": "10"}], "OrderLines": [{...}] } }]

asked 11 Jan, 08:51

Frank's gravatar image

Frank
613142338
accept rate: 17%

edited 11 Jan, 08:53

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×20

question asked: 11 Jan, 08:51

question was seen: 102 times

last updated: 11 Jan, 08:53