Skip to content
Advertisement

Get the count of records from another table

I have a view that looks like this:

enter image description here

which is defined using this SQL statement:

Now I want to count the records for another table (TABLE 2) based on the C_CODE, P_CODE and PH_CODE and display it as a column TOTAL in my view.

How can I do this?

enter image description here

Advertisement

Answer

one way is to use subquery:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement