Table_1 shows the picture below It has a number and its corresponding name.
And table_2 has numbers.
select number, name from table_1
Can I check the number and name of table_1 by selecting it as above and check how many times the number exists in table_2 at once?
select one.number, one name, count(two.number) from table_1one
left join(?) table_2 two ~~~
group by two.Number
I want to select it right away like this, but I don't know how...
sql mssql select join count
select
one.number,
max(one.name) AS name,
Count (two.number) AS count
FROM Table1 one
JOIN Table2 two on two. Number = one. Number
GROUP BY ONE.Number /* You must group with this to compute the rest. */
© 2024 OneMinuteCode. All rights reserved.