Thursday, July 30, 2009

Oracle: Group by only certain fields in a table.

If you need to group by only fields, here is a way to do it. Say you have a table that has columns a,b,c,d,e and your goal is to group by b,c

SELECT MAX(a), b, c FROM MY_TABLE GROUP BY b, c

oracle inserting a blob value

use to_blob function to convert a string a blob and insert it.

For ex. insert into my_table values (to_blob('1234555');