Thanks for your reply
My actual requirement is with using 3 tables and need to get the data
CREATE TABLE BILL_DETAIL
([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
[x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) , [BILL2SUBCASE] int )
INSERT INTO BILL_DETAIL
([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE], [BILL2SUBCASE])
VALUES
(101, 'Customer', 3, 1, 20,'Parking',11),
(102, 'Customer', 1, 1, 25,'Car',12),
(103, 'Customer', 2, 1, 20,'Toll',11)
;
CREATE TABLE SUBCASE
([objid] int, [SUBCASE2ASSIGN] int,
)
INSERT INTO SUBCASE
([objid], [SUBCASE2ASSIGN])
VALUES
(11, 1),
(12, 2)
;
CREATE TABLE ASSIGN
([objid] int
)
INSERT INTO ASSIGN
([objid])
VALUES
(1),
(2)
;
using following query iam getting 2 records but i want to get only 1 record and cost type should get appending other record data as Parking,Toll
select BILL_DETAIL.COST_TYPE
from ASSIGN
inner join SUBCASE on SUBCASE.SUBCASE2ASSIGN=ASSIGN.objid
inner join BILL_DETAIL on BILL_DETAIL.BILL2SUBCASE=SUBCASE.objid
where ASSIGN.objid=1
Please suggest using stuff key word and group by i will only parameter for query
with the above schema i want to Pass parameter ASSIGN.objid=1 using inner relations with
select
billde
and need to the output with Cost Type Parking,Toll
please suggest me how to use it with 3 tables .
with the above schema i want to Pass parameter ASSIGN.objid=1 using inner relations with
select
billde
and need to the output with Cost Type Parking,Toll
please suggest me how to use it with 3 tables .