1
Answer

about the technological world of programming

Common Access

Common Access

9y
667
1
i am a student from Nepal who is a active online student of yours in YouTube.
i have many queries, i have listed them below:
1. difference between learning C# language in console and windows form app. if i learn it in console which i am doing, do i have to take another tutorial for windows form apps using C#??
2. why choose asp.net over php or any other web tools
3. why you have totally focused in C# and asp.net in your tutorials, basically MS tools, is there any concrete reason for it//
4. i want to be efficient programmer for web , desktop apps, mobile apps... what do u suggest for me? to build my career.
5. i am many times confused which tools to use like::
asp.net or PHP or JSP, JVscript or Jquery, Bootstrap or CSS or AJAX tools,
java or C#, MySQL or MS SQL, which web services is efficient to use, XML.....
native ways of developing android and ios OR (Phonegap,Xamarin....and other cross platform development tools for android and ios)
coz i see people making games with just HTML 5, then whats worth learning other hardcore programming languages..........
When i search for these things i really get confused to choos or from where to start.
i have choosen your order of learning in youtube, i have started C# without thinking anything where it will lead me and will continue to asp.net according to your order
plz sir, suggest me in all of the technologies of web, mobile apps and desktop apps according to you and the trends of the computing world .....
coz i dont want miss out anything related for the development.
and also i want to know about you, as a developer and your work, tools used and experiences...
sir, plz reply in every detail possible,
what is WPF,WCf,W..?? of windows??
Answers (1)
0
Pankaj  Kumar Choudhary

Pankaj Kumar Choudhary

NA 29.8k 3.1m 9y
SELECT sum(cte.TARGET) "target" , sum(cte.ACHIEVED) "achieved" FROM (SELECT SUM(TargetValue) AS TARGET ,SUM(AchievedValue) AS ACHIEVED FROM First F
INNER JOIN Second AS S ON S.QuestionID=F.QuestionID
Where 1=1
group by S.RecordID)cte
0
Danish Habib

Danish Habib

NA 691 122.9k 9y
it is giving the wrong result and meanwhile it does not allow to apply where clause
0
Krishna Murthy

Krishna Murthy

NA 1.2k 86.8k 9y
Hi,
 
Select Sum(Target) from FirstTable
Union
Select Sum(Archived) from SecondTable 
0
Danish Habib

Danish Habib

NA 691 122.9k 9y
I want SUM OF BOTH TARGET AND ACHIEVED , 
 QUESTIONID(P)    TARGET
 1200
 2 300
Second table
 RecordID(P) QuestionID(F) Achieved
 1 1 10
 2 1 200
 3 2 300
I WANT SOME OF TARGET and SUM OF ACHIVED like
SUM OF TARGET SHOUD BE (500) and SUM OF ACHIEVED SHOULD BE (510) 
0
Danish Habib

Danish Habib

NA 691 122.9k 9y
Table First 
 QuestionID(primaryKey) TargetValue
 1 100
 2 500
 3   200
Second Table
 RecordID(primaryKey) Achieved Value QuestionID(foreignkey)
 1 14 1
 2 14 1
 3 16 2
 
 As per Manas told
Please find below query if you want to get 100:
SELECT SUM(Achieved) AS ACHIEVED, [Target]
FROM tabl1
INNER JOIN tabl2 on tabl2.QuestionID=tabl1.QuestionID
group by tabl1.QuestionID, tabl1.Target
 
1-I want to calculate SUM of Target and SUm of achieved not just target and sum of achieved
I want while calculating SUM of Target
SELECT SUM(QuestionTarget) will takes 100 regardless of how many rows in the second table against question 01 ....
 
if inner join create problem i have tried left outer join as well it also not giving the desired result 
0
Krishna Murthy

Krishna Murthy

NA 1.2k 86.8k 9y
Hi Danish,
 
your query is wrong.  with your expectation, below query would suit your requirments
 
SELECT F.QuestionID, TargetValue, , Sum(Archived Value)
FROM FirstTable F INNER JOIN SecondTable S ON F.QuestionID = S.QuestionID
Where F.QuestionID = 1
Group by F.QuestionID, TargetValue
Order by F.QuestionID
 
0
Danish Habib

Danish Habib

NA 691 122.9k 9y
First TAble 
 QuestionID    Target Value    Men Women BoyGirl  CITY 
 1 200 100 25 25 50 LAHORE 
 2    400     LAHORE 
 
 
 Second Table 
 QuestionID(Foreignkey) Achived Value Village 
 1100 First  
 1 200 Second 
 
 
The problem is that i want to get the sum of Target and sum of achieved  values and also want to give the parameters @QuestionID for which i want the sum in crystal report
 
the issue is that if i have one row in first table for question ID 1 and two rows in second table for question ID 1 when i want to calculate the sum of Target vs sum of achived
my Answer table has two rows so due to inner join it return two rows and it adds my target value two times for question id =1
 
SELECT SUM(ISNULL(0,TargetValue) from First AS F
INNER JOIN Second AS S ON S.QuestionID=F.QuestionID
so my Target value sum becomes 400 instead of just 200 due to two rows in second table .. 
0
Krishna Murthy

Krishna Murthy

NA 1.2k 86.8k 9y
SELECT mt.ID,  COUNT(d.MasterID) as [#Count]
FROM MasterTable mt
INNER JOIN Detail d on mt.ID = d.ID
GROUP BY mt.ID
ORDER BY mt.ID
0
Danish Habib

Danish Habib

NA 691 122.9k 9y
My issue is just when i join using inner join the join append the values for all rows comming from second table so the sum is incorrect mean that if i have 30 rows in second table and one  row in  the first table   and when i inner join all the thirty rows gets value of first row from the first table 
0
Danish Habib

Danish Habib

NA 691 122.9k 9y
I have tried listen to me once more, I have a table in which i have a target value for user that they have to achieve this target for example "Build new schools in village " I give them a target of 100 for whole City , Now he/she has 300 villages in this city so he has to submit his achivement against these targets so 300 rows when i inner join and try to make the sum of target value vs sum of achieved value all 300 rows in achived table gets value of 100 so how to get that ...
0
Krishna Murthy

Krishna Murthy

NA 1.2k 86.8k 9y
Hi Dhanish,
 
SELECT mt.ID, mt.NAME, mt.AGE, COUNT(d.MasterID) as [#Subjects]
FROM MasterTable mt
LEFT OUTER JOIN Detail d on mt.ID = d.ID
GROUP BY mt.ID, mt.NAME, mt.AGE
ORDER BY mt.ID
 
Hope this might help you. If it suits your requirement, pls mark it as answered.
0
Sumit Joshi

Sumit Joshi

NA 1.9k 62.5k 9y
Hi Danish,
 
Please share the Query that is not showing relevent results