因此,在一个表中,我可以使用replace和charindex来提取与另一个表中的主键相关的特定ID,然后我想基于修剪后的值连接另一个表中的数据,我该怎么做呢?select top 100 *, Replace(Left(LogValue,Charindex(';', LogValue) - 1) ,'RtaId=', '') as TaskID, PrmRoutingTaskTaskID
where Log
使用查询结果作为select语句的表名的任何方式。我尝试了下面的查询@tblname is jsut结果集,而不是我需要的字符串结果:declare @sql nvarchar(1000)set @stand = 'test'
set @sql = 'select @temp=atbl.table_name from test
是否可以基于表1的列值等于table_2列名将两个表连接在一起?-----|---| |-----------|----- ------------- 期望的结果是: Select A from table_1 join table_2 WHERE table_1 A = table_2 column name.Result:
1Q 我使用的是PHP,对于可怜<e
我想获得MAX的int列,但我的列是循环变量。我试过这个Declare @gender nvarchar(10)Declare @col int
set @gender='0'
set @sql = 'Select @max = MAX(@col) From CustomerTbl Where Gender=@gender&