rodrigo_fabiam (8/7/2014)
Hi, Evil Kraig F.There is not this colums.
It is because this that I want to show this way for the user.
Because they will have to mark what site is each kit. At the end, it will like this way:
How do you know what goes into each kit? The solution above by Luis will give you what you need with what's presented, but it comes with a concern: Your association is completely random. It's going to sort out in whatever order the database coughs it up in, and won't deal with, for example, two kit sets repeated 3 times each. At least not well.
Your example is oversimplified for a production system, because it just can't work that way long term because there's no associations outside of a single table's row order. If you've got other controls already making sure that you're restricting it to a single kit type for a single invoice (I'm making a crapload of assumptions here), then Luis' solution will work. Otherwise, you'll need to get us a more holistic view of your schema to help you not shoot yourself in the foot.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA