我正在尝试Insert Select
使用其他参数进行查询,但它不起作用。下面是我的代码:
INSERT INTO [epmscdc].[dbo].[billing]
([pid] ,[did] ,[lid] ,[totalamt] ,
[cash] ,[bchange] ,[btrans_date])
SELECT patientlab.did, patientlab.pid,
patientlab.lid, laboratory.lprice
FROM patientlab
INNER JOIN laboratory
ON patientlab.lid = laboratory.lid
INNER JOIN doctor
ON patientlab.did = doctor.did
WHERE patientlab.pid = 3
AND pstatus = '-', 1000,1000,GETDATE())
我只想从其他表中选择特定字段,我想从文本框中获取cash
, change
,trans_date
那么我该怎么做呢?