query

No More Spool Space Teradata Query Solution

Have you ever come across a situation called NO MORE SPOOL SPACE?  My friend does and hence I studied a bit about Teradata. The query: SELECT DISTINCT fieldname FROM tablename; The error: “NO MORE SPOOL SPACE”. Correct, the problem wasn’t related to MySQL, that was for something called Teradata. Initially, I could see that query should be using temporary space (from name SPOOL SPACE I guessed) to get distinct data – may be it’s a huge table or something. So I think one has to look into temporary table space’s size – they call it SPOOL SPACE. Next is Google’s turn to...

Oracle query-eliminate duplicate but one using rowid

Yesterday a friend came across an oracle query problem: Consider below table: cid cname…. cdata 1 x xxxx 1 x xxxx .. 2 xzzz fjnd 3 a evddd Now the problem was cid is repeated and cdata column is having some extra characters but data is considered same (eg. xxxx & xxxx..). so when he does SELECT cid,cname….cdata FROM TABLENAME ….; He kept on getting duplicated records which intern he wanted to have only one per duplicated cid. It’s not by the way of table structure but by the way of query he wanted to have results. I suggested him:...