Two Same Queries With One Difference
Dec 2, 2007
Hello!
I have a query with multiple table joints and where clauses. Tables are huge and query runs for a very long time. I need to run another query, which is exactly the same apart for one Where clause (first time price = "P", second time price = "S"). I use this for BIRT report, which means I need to have a result of there two queries at the same time. I can run them at the same time, but because they are both huge it takes a Long time. I wonder if I can make only one query, will it be faster? And if it will- what’s the best way to make it?
Thank you for your help!
Please let me know if it is not clear.
Roughly my code:
Select * FROM sales_item d
join (select str_to_date('2007-09-30', '%Y-%m-%d') st_date) v
join item_store f on f.item_no=d.item_no and f.store_id = d.store_id
join item_sellprice_store a on f.item_no=a.item_no and f.store_id = a.store_id
join item b on f.item_no=b.item_no
join item_supplier c on b.item_no=c.item_no and b.supplier_no=c.supplier_no
join item_sellprice_storegroup g on a.batch_id=g.batch_id
join store k on f.store_id =k.store_id
where d.store_id = '011'
and (f.item_status ='A' or f.item_status ='O')
and a.price_type='P'
and a.effective_start_date < v.st_date < a.effective_end_date
and d.sale_date = v.st_date
order by d.category_code, a.sell_gst, a.item_no ;
And the second one is exactly the same apart from highlighted line (it’s a.price_type='S')
View 8 Replies
ADVERTISEMENT
Jul 31, 2004
Hi
I am pretty new to database. I want to know the difference between the 2 queries given below
1>SELECT B.col4, A.col4 , A.col5, C.col5
from tbltpcheckout A with (nolock)
inner join tblTPEFTPayPal B with (nolock)
on A.col1 = B.col1
inner join tbltpuser C with (nolock)
on A.col3 = C.col3
where A.col2 = CONTP_CHECKOUT_STATUS_PENDING
2>SELECT B.col4, A.col4 , A.col5, C.col5
from tbltpcheckout A with (nolock) ,
tblTPEFTPayPal B with (nolock),
tbltpuser C with (nolock)
where
A.col1 = B.col1 and
A.col3 = B.col3 and
A.col2 = CONTP_CHECKOUT_STATUS_PENDING
If any one can help me in understanding the difference
Thanks
Murali
View 1 Replies
View Related
Feb 21, 2008
Hi All,
Is there any difference between the two queries given below..I am not able to find any but am not sure. Kindly help.
A)
select a.* from( select top 1 hs.last_modified, hs.price, hs.revision_date
from history hs where hs.last_modified < '06-Jan-2008' order by hs.last_modified desc)a
order by a.revision_date desc
B)
select hs.last_modified, hs.price, hs.revision_date
from history hs where hs.last_modified < '06-Jan-2008'
order by hs.last_modified desc, hs.revision_date desc
Thanks,
Pradeep.D
View 4 Replies
View Related
Oct 24, 2007
Question is in the subject.
Thanks in advance
-Jamie
View 7 Replies
View Related
Jul 20, 2005
HelloWhen I use a PreparedStatement (in jdbc) with the following query:SELECT store_groups_idFROM store_groupsWHERE store_groups_id IS NOT NULLAND type = ?ORDER BY group_nameIt takes a significantly longer time to run (the time it takes forexecuteQuery() to return ) than if I useSELECT store_groups_idFROM store_groupsWHERE store_groups_id IS NOT NULLAND type = 'M'ORDER BY group_nameAfter tracing the problem down, it appears that this is not preciselya java issue, but rather has to do with the underlying cost of runningparameterized queries.When I open up MS Enterprise Manager and type the same query in - italso takes far longer for the parameterized query to run when I usethe version of the query with bind (?) parameters.This only happens when the table in question is large - I am seeingthis behaviour for a table with > 1,000,000 records. It doesn't makesense to me why a parameterized query would run SLOWER than acompletely ad-hoc query when it is supposed to be more efficient.Furthermore, if one were to say that the reason for this behaviour isthat the query is first getting compliled and then the parameters aregetting sent over - thus resulting in a longer percieved executiontime - I would respond that if this were the case then A) it shouldn'tbe any different if it were run against a large or small table B) thisperformance hit should only be experienced the first time that thequery is run C) the performance hit should only be 2x the time for thenon-parameterized query takes to run - the difference in response timeis more like 4-10 times the time it takes for the non parameterizedversion to run!!!Is this a sql-server specific problem or something that would pertainto other databases as well? I there something about the coorect use ofbind parameters that I overall don't understand?If I can provide some hints in Java then this would be great..otherwise, do I need to turn/off certain settings on the databaseitself?If nothing else works, I will have to either find or write a wrapperaround the Statement object that acts like a prepared statement but inreality sends regular Statement objects to the JDBC driver. I wouldthen put some inteligence in the database layer for deciding whetherto use this special -hack- object or a regular prepared statementdepending on the expected overhead. (Obviously this logic would onlybe written in once place.. etc.. IoC.. ) HOWEVER, I would desperatelywant to avoid doing this.Please help :)
View 1 Replies
View Related
Feb 28, 2007
What is the difference between below? And how can I make GETDATE() the same as System.DateTime.Today.ToShortDateString()?
System.DateTime.Today.ToShortDateString()
and
GETDATE()
View 2 Replies
View Related
Feb 5, 2008
Hi all,
What is the difference between SQL Server 2000 & SQL Server 2005?
Thanks!
View 2 Replies
View Related
Jul 7, 2000
Can anybody tell me what is the difference between backing up database to a file and backing up to backup device.
Thanx in adv.
View 1 Replies
View Related
Dec 16, 2002
Hello,
I am transfereing Data into text format.
The datas are about 5 table and has almost 50000 to 2 million rows.
I am using the same query for BCP and DTS. But I find the dreference between those. I mean DTS is taking less memory and more time than BCP to complete the process .
Anybody can share any comment for this issue ?.
View 6 Replies
View Related
Aug 18, 2004
Can somebody tell or may refer to a site that show the differences between SQL Server 2000 SP2 and SP3a.
Thanks.
View 1 Replies
View Related
Mar 10, 2004
Is there really a difference of approach?
I have several things to consider in an estimating database. Production, Shipping, Field Work, Field Hardware, etc...
All of the above have account numbers. Now I was wondering, would there be any benifit to having one table or several tables?
One Table Example
Account (PK) | Category | Description
or
Multiple tables
tbProduction
Account (PK) | Description
tbShipping
Account (PK) | Description
tbProducts
Account (PK) | Description
etc.....
I like having the tables split up and/or all in one.
Any thoughts, pros / cons?
Mike B
View 2 Replies
View Related
Apr 9, 2008
What is the difference between stored procedure and functions ?
thanx in advance
View 7 Replies
View Related
May 16, 2006
Hi,
What is the difference between Inline-table value function and multi statement table value function?
Thanks In Advance
View 6 Replies
View Related
Sep 4, 2006
Hi Experts,
please tell me the difference between BCP and DTS
provide me links if possible.
thankyou very much
View 2 Replies
View Related
Sep 8, 2006
hello friends,
i've bee working in DTS just from 2 days.
i've one database like 'x' and now i've exported the data to a newly created database 'y'
but in this y database i got much memory like around 30 mb.
why this happend?
sorry if this is a small question.
thankyou friends
View 1 Replies
View Related
Jan 16, 2007
Hi
I want to know the difference between
SQL server Express and
SQL server 2005 Express Edition.
Thanks
Yimoot.
View 1 Replies
View Related
Feb 6, 2007
hi, i'm having difficulty figuring out how to implement a set difference between two queries. the only set operator i've been able to come across is union. thanks in advance!
d
View 3 Replies
View Related
Dec 21, 2007
Hi all,
May any one tell the differnce between t-sql Stored procedure and the same SP written in CLR compatible?.Will CLR SP really improve the performance?
Your response will be highly appreciated.
Thanks in advance
View 1 Replies
View Related
Jul 6, 2006
Hi everyone,
What is the real difference among them ?
CREATE PROCEDURE sp_devamsizlik
@ADI CHAR(20)
AS
SELECT *
FROM OGRENCI
WHERE ADI=@ADI
GO
--------------------------------------------------------------------------------------
CREATE FUNCTION sp_devamsizlik
(@ADI
CHAR(20) )
RETURN TABLE
BEGIN
RETURN( SELECT * FROM OGRENCI WHERE ADI=@ADI )
END
View 6 Replies
View Related
Apr 24, 2007
Are SQL Server Express & SQL Server 2005 one & the same thing? Or is the former a part of the latter? Actually when I was downloading Visual Web Developer 2005 Express, I was given the option to download Microsoft SQL Server 2005 Express Edition as well; so I am getting confused between SQL Server Express & SQL Server 2005.
I installed SQL Server 2005 in my WinXP Pro m/c. from the Microsoft website (after re-installing WinXP Pro since XP became corrupt). Earlier I used to login to Management Studio Express using my m/c. name followed by a followed by SQLEXPRESS as the server name. So if my m/c. name is MyPC, then I used to login to Management Studio Express using MyPCSQLEXPRESS as the server name but now when I try to login to Management Studio Express using the above server name i.e. MyPCSQLEXPRESS, then an error gets thrown saying
Cannot connect to MyPCSQLEXPRESS.
Now how do I find out what's the server name so that I can login to create & manage databases in Management Studio Express?
Please note that after re-installing WinXP Pro, my m/c. name has remained the same; I didn't change it.
Thanks,
Arpan
View 5 Replies
View Related
Sep 29, 2007
Hi,
I want to know what are the differencve between CONTAINS and LIKE, Which is better to use and in which condition.????
I searched on google but can't able to find out major differnces or any good article realted to this,
View 5 Replies
View Related
Sep 7, 2007
Hai,
I want to know what is the difference between views and joins. why we are going for views in sql server.
View 8 Replies
View Related
Feb 22, 2008
I have two numeric variables in T-SQL - @Var1 and @Var2These variables can be positive or negative. I want to find the difference between the two variables, eg:@Var1 = -50@Var2 = 25Difference = 25 @Var1 = -50@Var2 = -40Difference = 10 @Var1 = 60@Var2 = 10Difference = 50 Is there a function in SQL Server to carry this out?
View 4 Replies
View Related
Mar 11, 2008
How to find a month difference using sql query?
View 4 Replies
View Related
Feb 2, 2004
Between having SQL and using SQL server enterprise manager with MSDE
View 1 Replies
View Related
Nov 29, 2004
Hi All,
It may be sound weird. I want to find the difference between SQL Stored procedure and functions. I knew a couple one is for function, parameter is must where as in SP its not, second is function would return a value whereas procedure wont.
Is there anythign else???
View 6 Replies
View Related
Aug 19, 2005
I want to create a View, which contains columns from two tables, and an additional column, which should calculate the difference between two dates.01/05/2005 7:30 AM - 01/05/2005 8:00 AMThe column should be a calculated column,Can I assign the value of a column to a user defined function?In the UDF, how to get the difference between those two dates to be: "00:30"Are there SQL Server functions to time and date that allows me to do so? I have dateadd, datediff, but I am unable to figure out the 2 problems above.thank you,
View 10 Replies
View Related
Aug 21, 2005
In my table i have two cols and datatype datetime, for example they has the values,--------StartDate --------------------------------------- StopDate ------______________________________________________01/05/2005 7:30 AM ------------------------ 03/05/2005 10:00 AM13/05/2005 2:30 PM ------------------------- 01/08/2005 8:00 PM_____________________________________________How do I find out the avg time difference between StopDate and StartDate? I tried AVG(StopDate - StartDate ), but it's giving me the following error message. "The average aggregate operation cannot take a smalldatetime data type as an argument."Thanks for any reply.
View 1 Replies
View Related
Dec 5, 2005
can anyone please tell me the difference between group by and having clause.
View 2 Replies
View Related
Mar 9, 2001
Hi,
I have a view in a database called PS_EMPLMT_SRCH_US and it joins around five tables. I have two databases which are identical structures including data. But when run one query
ie "SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS' ",
response time is totally different even though both databases have same data and same indexes. When I looked at showplan and stats time, both are totally different and order of table fetch is totally different. Is there any idea why this difference? Any help would be appreciated.
Here is the show plan info:
-------------------------------------------------------------------
GOOD Performance Query and plan
-------------------------------------------------------------------
SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS'
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server parse and compile time:
CPU time = 156 ms, elapsed time = 156 ms.
Table 'PS_SCRTY_TBL_DEPT'. Scan count 2, logical reads 4, physical reads 0, read-ahead reads 0.
Table 'PSTREENODE'. Scan count 13, logical reads 26, physical reads 0, read-ahead reads 0.
Table 'PS_JOB'. Scan count 29, logical reads 87, physical reads 0, read-ahead reads 0.
Table 'PS_NID_TYPE_TBL'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
Table 'PS_PERS_NID'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
Table 'PS_PERSONAL_DATA'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 5 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
PLAN:
|--Nested Loops(Left Semi Join)
|--Nested Loops(Inner Join)
| |--Nested Loops(Inner Join)
| | |--Nested Loops(Inner Join)
| | | |--Filter(WHERE:([PS_JOB].[EFFSEQ]=[Expr1016]))
| | | | |--Nested Loops(Inner Join)
| | | | |--Filter(WHERE:([PS_JOB].[EFFDT]=[Expr1012]))
| | | | | |--Nested Loops(Inner Join)
| | | | | |--Nested Loops(Inner Join)
| | | | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_PERSONAL_DATA].[PS#PERSONAL_DATA]), SEEK:([PS_PERSONAL_DATA].[EMPLID] >= '00918' AND [PS_PERSONAL_DATA].[EMPLID] < '00919') ORDERED)
| | | | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PS#JOB]), SEEK:([PS_JOB].[EMPLID]=[PS_PERSONAL_DATA].[EMPLID]) ORDERED)
| | | | | |--Table Spool
| | | | | |--Stream Aggregate(DEFINE:([Expr1012]=MAX([PS_JOB].[EFFDT])))
| | | | | |--Top(1)
| | | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT] <= Convert(Convert(getdate()))) OR
| | | | |--Table Spool
| | | | |--Stream Aggregate(DEFINE:([Expr1016]=MAX([PS_JOB].[EFFSEQ])))
| | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT]=[PS_JOB].[EFFDT]) ORDERED)
| | | |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_PERS_NID].[PS_PERS_NID]), SEEK:([PS_PERS_NID].[EMPLID]=[PS_JOB].[EMPLID]) ORDERED)
| | |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_NID_TYPE_TBL].[PS_NID_TYPE_TBL]), SEEK:([PS_NID_TYPE_TBL].[COUNTRY]=[PS_PERS_NID].[COUNTRY] AND [PS_NID_TYPE_TBL].[NATIONAL_ID_TYPE]=[PS_PERS_NID].[NATIONAL_ID_TYPE]) ORDERED)
| |--Filter(WHERE:(like([PS_SCRTY_TBL_DEPT].[OPRID], 'ALLPANLS')))
| |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_SCRTY_TBL_DEPT].[PS_SCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[OPRID] BETWEEN 'ALLPANLS' AND 'ALLPANLS') ORDERED)
|--Row Count Spool
|--Filter(WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate())) OR (([PS_SCRTY_TBL_DEPT].[ACCESS_CD]='Y' AND [PS_JOB].[EFFDT]=[Expr1022]) AND [Expr1031])))
|--Nested Loops(Left Semi Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
|--Nested Loops(Inner Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
| |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PS_JOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID]) ORDERED)
| |--Table Spool
| |--Stream Aggregate(DEFINE:([Expr1022]=MAX([PS_JOB].[EFFDT])))
| |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT] <= Convert(Convert(getdate()))) ORDERED)
|--Row Count Spool
|--Nested Loops(Left Anti Semi Join, WHERE:([PSTREENODE].[TREE_NODE_NUM]>=[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM] AND [PSTREENODE].[TREE_NODE_NUM]<=[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM_END]))
|--Index Seek(OBJECT:([HRNEW].[dbo].[PSTREENODE].[PSCPSTREENODE]), SEEK:([PSTREENODE].[TREE_NODE]=[PS_JOB].[DEPTID] AND [PSTREENODE].[SETID]=[PS_SCRTY_TBL_DEPT].[SETID] AND [PSTREENODE].[TREE_NAME]='DEPT_SECURITY' AND [PSTRE
|--Filter(WHERE:([PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]<[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM] OR [PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]>[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]))
|--Index Seek(OBJECT:([HRNEW].[dbo].[PS_SCRTY_TBL_DEPT].[PSASCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[OPRID]=[PS_SCRTY_TBL_DEPT].[OPRID] AND [PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM] BETWEEN [PS_SCRTY_TBL_DEPT].[TREE_NODE_
-----------------------------------------------------------------------------
BAD Performance Query and plan
-------------------------------------------------------------------------
SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS'
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
Table 'PS_JOB'. Scan count 168595, logical reads 515067, physical reads 0, read-ahead reads 0.
Table 'PS_PERSONAL_DATA'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
Table 'PS_PERS_NID'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
Table 'PS_NID_TYPE_TBL'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
Table 'PS_SCRTY_TBL_DEPT'. Scan count 2, logical reads 4, physical reads 0, read-ahead reads 0.
Table 'PSTREENODE'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
SQL Server Execution Times:
CPU time = 15797 ms, elapsed time = 4500 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
|--Nested Loops(Left Semi Join)
|--Nested Loops(Inner Join, WHERE:([PS_JOB].[SETID_DEPT]=[PS_SCRTY_TBL_DEPT].[SETID]))
| |--Parallelism(Gather Streams)
| | |--Hash Match(Inner Join, HASH:([PS_PERS_NID].[EMPLID])=([PS_JOB].[EMPLID]), RESIDUAL:([PS_JOB].[EMPLID]=[PS_PERS_NID].[EMPLID]))
| | |--Parallelism(Distribute Streams, PARTITION COLUMNS:([PS_PERSONAL_DATA].[EMPLID]))
| | | |--Nested Loops(Inner Join)
| | | |--Nested Loops(Inner Join)
| | | | |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_PERSONAL_DATA].[PS#PERSONAL_DATA]), SEEK:([PS_PERSONAL_DATA].[EMPLID] >= '00918' AND [PS_PERSONAL_DATA].[EMPLID] < '00919') ORDERED)
| | | | |--Clustered Index Seek(OBJECT:([HRTEST].[dbo].[PS_PERS_NID].[PS_PERS_NID]), SEEK:([PS_PERS_NID].[EMPLID]=[PS_PERSONAL_DATA].[EMPLID]) ORDERED)
| | | |--Clustered Index Seek(OBJECT:([HRTEST].[dbo].[PS_NID_TYPE_TBL].[PS_NID_TYPE_TBL]), SEEK:([PS_NID_TYPE_TBL].[COUNTRY]=[PS_PERS_NID].[COUNTRY] AND [PS_NID_TYPE_TBL].[NATIONAL_ID_TYPE]=[PS_PERS_NID].[NATIONAL_ID_TYPE]) ORDERE
| | |--Filter(WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate())) OR ([PS_JOB].[EFFDT]=[Expr1018] AND [PS_JOB].[EFFSEQ]=[Expr1022])))
| | |--Parallelism(Repartition Streams, PARTITION COLUMNS:([PS_JOB].[EMPLID]))
| | |--Nested Loops(Inner Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
| | |--Parallelism(Repartition Streams, PARTITION COLUMNS:([PS_JOB].[EMPLID], [PS_JOB].[EFFDT], [PS_JOB].[EMPL_RCD#]), ORDER BY:([PS_JOB].[EFFDT] ASC, [PS_JOB].[EMPL_RCD#] ASC, [PS_JOB].[EMPLID] ASC))
| | | |--Nested Loops(Inner Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
| | | |--Sort(ORDER BY:([PS_JOB].[EFFDT] ASC, [PS_JOB].[EMPL_RCD#] ASC, [PS_JOB].[EMPLID] ASC))
| | | | |--Clustered Index Scan(OBJECT:([HRTEST].[dbo].[PS_JOB].[PS_JOB]))
| | | |--Table Spool
| | | |--Stream Aggregate(DEFINE:([Expr1018]=MAX([PS_JOB].[EFFDT])))
| | | |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT] <= Convert(Convert(getdate()))) O
| | |--Table Spool
| | |--Stream Aggregate(DEFINE:([Expr1022]=MAX([PS_JOB].[EFFSEQ])))
| | |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT]=[PS_JOB].[EFFDT]) ORDERED)
| |--Filter(WHERE:(like([PS_SCRTY_TBL_DEPT].[OPRID], 'ALLPANLS')))
| |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_SCRTY_TBL_DEPT].[PSBSCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[ACCESS_CD]='Y' AND [PS_SCRTY_TBL_DEPT].[OPRID] BETWEEN 'ALLPANLS' AND 'ALLPANLS') ORDERED)
|--Row Count Spool
|--Nested Loops(Left Anti Semi Join)
|--Index Seek(OBJECT:([HRTEST].[dbo].[PSTREENODE].[PSCPSTREENODE]), SEEK:([PSTREENODE].[TREE_NODE]=[PS_JOB].[DEPTID] AND [PSTREENODE].[SETID]=[PS_SCRTY_TBL_DEPT].[SETID] AND [PSTREENODE].[TREE_NAME]='DEPT_SECURITY' AND [PSTREENODE].[EFFDT]
|--Filter(WHERE:([PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]<>[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]))
|--Index Seek(OBJECT:([HRTEST].[dbo].[PS_SCRTY_TBL_DEPT].[PSASCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[OPRID]=[PS_SCRTY_TBL_DEPT].[OPRID] AND ([PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM], [PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM_END], [PS_SCRTY_
View 1 Replies
View Related
Aug 22, 2003
Hi I wanted to get difference between this two dates '12-31-2001','01-01-2002').
1 day 0 month 0 year.
Do we have any date function to get like this or we need write our own function stored proc?>
Any advice please?.
View 1 Replies
View Related
Oct 6, 2003
Hi ,
I need logic for find the month diffrence.
For example
'08/05/2003','10/01/2003'
I should get difference between these two date is 1.
Thanks,
Ravi
View 6 Replies
View Related
Nov 3, 2005
Hi all.
when I perform the query below
select * from tbl where fld='hello'
queries that contents hello or Hello or HeLLo appears.
but if I write only hello,I want only it !
is this possible in query ?
View 1 Replies
View Related