Is there any better way to write this quary. It takes such a lot time to execute this
"Select resp_init from dbo_tistvact where" & _
"resource_comp in ( Select componentcode from PUBLIC_MSOT_COMPONENTCODE WHERE ID = 24))"
HardCode
04-14-2004, 10:28 AM
Is the value of "resource_comp" in table dbo_tistvact the same as "componentcode" from PUBLIC_MSOT_COMPONENTCODE ?
Is the value of "resource_comp" in table dbo_tistvact the same as "componentcode" from PUBLIC_MSOT_COMPONENTCODE ?
Thanks hardcode
The Answer for that is YES both are same
Ok I fixed it. using,
SELECT DISTINCT resp_init
FROM dbo_tistiact INNER JOIN TBMSO_MSOT_COMPONENTGROUP ON dbo_tistiact.resource_comp = TBMSO_MSOT_COMPONENTGROUP.componentcode
WHERE GMID = 24
but now I have to use that to do this,
Select firstname,lastname from dbo tistisech where inits in (
SELECT DISTINCT resp_init
FROM dbo_tistiact INNER JOIN TBMSO_MSOT_COMPONENTGROUP ON dbo_tistiact.resource_comp = TBMSO_MSOT_COMPONENTGROUP.componentcode
WHERE GMID = 24
)
This is a time killler any ideas please to make this faster. I am new to SQL. Thanks a google in advance.
As i mentioned resource_comp = componentcode