need help in my query

  • hello everyone, i have the following query:

    INSERT INTO ListingInstantPurchases (MemberID, UserShipping, eStoreID, Quantity, ListingID, ListingCost, TotalListingCost, ShippingCost, TotalShippingCost, InsuranceCost,

    TotalInsuranceCost, TaxCost, TotalTaxCost)

    SELECT MemberID, UserShipping, eStoreID, Quantity, ListingID, ListingCost, TotalListingCost, ShippingCost, TotalShippingCost, InsuranceCost, TotalInsuranceCost,

    TaxCost, TotalTaxCost

    FROM ShoppingCart

    WHERE MemberID = 10

    but it gives me the following error: "Subquery returned more than 1 value. This

    is not permitted when the subquery follows =,!= so on plz help me how can i copy data from i table to my already existing other table as i want to copy few columns not the whole table data.

    plz help me

  • Hi....

    I think this should not be the problem as this query is correct. You can very well insert the values. I dont think that this should be the case with this query until and unless you have triggers defined on that table on which you are inserting. Just check out for the dependency of that table for the trigger. May be this can just solve your problem. The query is perfectly correct.

     

    Amit

    Amit Tiwari
    Software Engineer
    Westbase Technology Pvt Ltd
    Pune

  • hi

    yes trigger might be the cause of the problem.

    "Keep Trying"

  • You may want to try SELECT INTO.

  • Your query (as posted) cannot possibly return the error in your post.  This is a very straight forward error and there must be a sub-query involved where you are comparing the results to a single value.  Is there some other code surrounding the INSERT that you've posted?  If not, check the triggers as previously suggested. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply