vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Version MySQL 5.0.45 Community-nt-log via TCP/IP Client MySql Cleint version 5.1.11 I'm attempting to build a stored procedure that uses inner joins to limit returned records. When I test this in a query window it runs correctly (and quickly). After moving the code to a stored procedure I'm finding that it times out without returning anything... Any help with the syntax appreciated... Code below. SELECT o.ID as trackingNbr, o.OrderDate as submitted, ci.FirstName, ci.LastName, o.businessnumber FROM tblorders o INNER JOIN tblCustomerInfo ci on o.id = ci.orderID INNER JOIN (Select ID from tblOrders where orderdate >= pStartDate and OrderDate <= pEndDate or IfNull(pStartDate, 1)=1) dte on (o.ID = dte.ID) INNER JOIN (select OrderID from tblCustomerInfo where firstname LIKE pFirstName or IfNull(pFirstName,1) = 1)fun on (o.ID = fun.OrderID); |
| Thread Tools | |
| Display Modes | |
|
|