Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. SQL Join? na I know a better way.....

SQL Join? na I know a better way.....

Scheduled Pinned Locked Moved The Weird and The Wonderful
databasequestion
1 Posts 1 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ra ra ra ra
    wrote on last edited by
    #1

    Once had the great pleasure of having to examine our banks End of Day processor. part of the app had the ability to show the account transaction records, which they used to dump transactions to luvly excel spreadsheets for analysis.... the guy who wrote it obviously had never heard of SQL joins though he used a SQL statement along the lines of "Select * from tran" to retrieve all the records, then entered into a mother loop. for each row in result for each column in the result if the datatype is a int, it must be a foreign key do a whole load of messin to work out the foreign key table so do another sql statement to pull back the foreign key value from another table output the foreign key value else output the value end if next column next row. worked out that each time a new transaction was entered onto the system this loop would have to do another 60 or so new SQL requests. so instead of one sql query using multiple joins to get foreign key values, this numpty wrote over 60 queries, which fired for each and every row output. and considering this was only a weeee bank, We did only have in the region of 5 million transactions with about another 100,000 or so a month getting added.. and they wondered why it could take ages to display only a few hundred thousand records and output them.......... :mad:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups