I have 2 MySql tables. users with an identifier and username; streams with userId and streamId. How to get them as / append them to a single table containing only username | streamIdas an SQL response? With one SQL query.
username | streamId
you can do the following:
select a.username, b.streamId from names a, streams b where a.userId = b.userId;
select tb1.username, tb2.streamid from tb1 inner join tb2 on tb2.userid = tb1.userid
The answer above returns the same results, just contains an implicit connection, which is slower for me.
select u.username, max(s.streamId) as streamId from users u inner join streams s on u.id = s.userId group by u.username
Source: https://habr.com/ru/post/1744556/More articles:How to get a stable, instant user interface using streams? - multithreadingProblem with CheckBoxes ASP.NET MVC - asp.net-mvcWhat can cause a double page request? - phpIn ASP.NET MVC, how to make a partial view available to all controllers? - asp.net-mvcto find a row in a DataGridView - stringuncaught exception: syntax error after jQuery update - jqueryКак IObservable. Предполагается, что работа должна работать? - .netHow to show grouping in WPF Data Grid with several levels? - c #Linq to SQL - How to check record does not exist before insert - linq-to-sqlWhat is a private API in an iPhone app? - iosAll Articles