tag:blogger.com,1999:blog-11802292.post8855874216611203740..comments2023-10-16T03:31:20.095-07:00Comments on Catherine: pyOraGeek: sqlpython 1.6.0 with Wild SQLAnonymoushttp://www.blogger.com/profile/12229578427522022392noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-11802292.post-75981903402159460312009-04-08T07:04:00.000-07:002009-04-08T07:04:00.000-07:00Hi again, Jack...Just saw this announcement of a S...Hi again, Jack...<BR/><BR/>Just saw this announcement of a SQL parsing module for Python:<BR/><BR/>http://python-sqlparse.googlecode.com/<BR/><BR/>... which might be a good way for wild SQL to find the columns in more complex queries like yours. So stay tuned. Or, better yet, join http://groups.google.com/group/sqlpython and help make it happen!Anonymoushttps://www.blogger.com/profile/12229578427522022392noreply@blogger.comtag:blogger.com,1999:blog-11802292.post-24967881779326697072009-04-06T16:12:00.000-07:002009-04-06T16:12:00.000-07:00Hi, Jack!Uh... hmm. Darn. That's a really good e...Hi, Jack!<BR/><BR/>Uh... hmm. Darn. <BR/><BR/>That's a really good example, but I don't think it will work with it. It finds-and-replaces the wildcards with a pretty basic search that only finds the first SELECT in a statement. You might be able to do it in a couple steps, making an intermediary table... I don't think it can handle it as-written, though.<BR/><BR/>Well, you've given me an incentive to improve Wild SQL's capabilities...Anonymoushttps://www.blogger.com/profile/12229578427522022392noreply@blogger.comtag:blogger.com,1999:blog-11802292.post-18090963019999242072009-04-06T15:49:00.000-07:002009-04-06T15:49:00.000-07:00Here is a common batch operation that would be gre...Here is a common batch operation that would be greatly simplified by Wild SQL. The specification is "Get rid of duplicate ids on dupe_tb; in case of ties, keep the latest date_added for each id". In regular SQL this is a pain because you have to explicitly list all the columns in dupe_tb just to avoid adding a new column called my_seq. Does Wild SQL work with create table as select (CTAS)?<BR/><BR/>- Jack<BR/><BR/><BR/>create table dedupe_tb<BR/>as<BR/>select *,<BR/> !my_seq<BR/>from (<BR/> select a.*,<BR/> row_number () over<BR/> (<BR/> partition by id<BR/> order by date_added desc nulls last<BR/> ) my_seq<BR/> from dupe_tb a<BR/> )<BR/>where my_seq = 1<BR/>;Jack Mulhollannoreply@blogger.comtag:blogger.com,1999:blog-11802292.post-34944060460914049072009-03-04T06:44:00.000-08:002009-03-04T06:44:00.000-08:00Thanks, Matt! Alas, sqlpython only works with Ora...Thanks, Matt! Alas, sqlpython only works with Oracle. I'd like to make it cross-RDBMS someday (and postgresql will be my first target), but it'll probably take 50-100 hours of work that my boss has no earthly reason to pay me for...Anonymoushttps://www.blogger.com/profile/12229578427522022392noreply@blogger.comtag:blogger.com,1999:blog-11802292.post-30503874194327919822009-03-04T06:34:00.000-08:002009-03-04T06:34:00.000-08:00Very nice. There's a feature in SAS (statistics p...Very nice. There's a feature in SAS (statistics package, sort of like SQL) that supported wildcards like that and I have missed it for years.<BR/><BR/>Does this work with postgres?Anonymousnoreply@blogger.com