Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. cjh999777

    Please help me with query syntax

    I have a query that works but it is really slow. Please let me know if there is a better way to do this so that it is quicker. Below is the query: delete NOBAL.* from ar__b23ccd as NoBAL inner join (select ptid from ar__b23ccd group by ptid having sum(balance)=0) as temp on temp.ptid =...
  2. cjh999777

    Please help me with query syntax

    do u mean the following using the as clause? select ptid from ar__b23ccd as temptable group by ptid having sum(balance) = 0
  3. cjh999777

    Please help me with query syntax

    if i change your version by addin 'in' like this delete from ar__b23ccd where ptid in( select ptid from ar__b23ccd group by ptid having sum(balance) = 0.00 ) Then i get the following error: You can't specify target table 'ar__b23ccd' for...
  4. cjh999777

    Please help me with query syntax

    I get the error below You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select ptid from ar__b23ccd group by ptid having sum(balance) = 0.00 )' at line 1
  5. cjh999777

    Please help me with query syntax

    yes that sellects all of the records so now how would i delete them? Do i use a join?
  6. cjh999777

    Please help me with query syntax

    sure bleow is the query that finds the rows select Sum(balance) as tltbal, ptid from ar__b23ccd as a group by ptid order by tltbal Thanks
  7. cjh999777

    Please help me with query syntax

    That is a good question and I think for the moment we will say that i want to delete all records from the table that have a sum of zero. If you can help shed some light on this it would be most helpfull. Thanks
  8. cjh999777

    Please help me with query syntax

    I need some help with this query. I have a table that contains purchase records. This table we can call "Purchases". Within this table I have a column called "ptid" which is related to the client info and there can be multiple records with the same "ptid". There is also a "balance" column. What...

Part and Inventory Search

Back
Top