I am working on a SQL query please this one is showing this error
Msg 116, Level 16, State 1, Line 2
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
This is the query
select
*,
(select top 1 *
from tbl_Renewal
where supid = b.S_id
and Payed = 1
order by
renewalid desc) as result
from
tbl_SuperAdmin as b
inner join
tbl_Renewal as c on b.S_id = c.supid
Please check and give me the solution
Any other solution for this actual task
please find the bellow task brief detail
table 1 'tbl_SuperAdmin' having on filed
data like example
s_id name age gtc.......
1 abc 23 .........
2 cda 42 ..........
another table 2 having 'tbl_Renewal'
renewalid renname date supid Payed etc......
1 first - 1 1 ........
2 first - 2 1 ........
3 second - 1 0 ........
4 second - 1 1 ........
5 third- 1 1 ........
thanks pradeep