August 12, 2005 at 9:27 am
hi
I have two tables -tblOrders and tblOrderPayments
tblorders contains orders and one of the columns in it is named ProductCode. The other table, tblOrderpayments contains a column called PaymentSuccess (a bit column).
I know there is a join involved here but I am unsure of syntax.
I want to pull all the rows where the productcode is X and where they also have a Payment success of '1'
Any help appreciated.
thanks
August 12, 2005 at 9:30 am
Something like this?
Select YourColumns from dbo.tblOrders O inner join dbo.tblOrderPayments OP on O.OrderID = OP.OrderID
where ?.ProductCode = @SomeValue and OP.PaymentSuccess = 1
August 12, 2005 at 9:47 am
Nice to see you're properly qualifying your DB objects Remi
August 12, 2005 at 9:59 am
Never been bitten by this one... and I'll keep it that way .
August 12, 2005 at 10:03 am
If only everyone were so diligent on this sort of thing, it would save me hitting people (developers) over their heads trying to make them do it right.
You'd be amazed at some of the excuses i've heard not to do it, the favourite one seems to be that they simply don't have the time to type the owner as well as the object itself
August 12, 2005 at 10:12 am
Tell them to use the freaking wizards, it types them by default and it saves 'em typing time .
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply