|
|
Choosing A Webhost: |
AW: [SQL question]: type checking/conversion: msg#00242db.maxdb
> sander hofstee wrote: > > > > Hi, > > > > I have a problem and I don't know if there is a solution, but I hope > so: > > > > I have a VARCHAR column with alphanumeric-, numeric- and date-values. > > Depending on the value of another column I know the type of the value > > (alphanumeric-, numeric- or date-value). > > When the type is a numeric value I need to cast it to a number, so it > > can be compared to another number. > > But if it is not a numeric value that row has to be skipped even > though > > it can be in the resultset.It works fine when > > there are only numeric values in the resultset. So I need to > > differentiate between the numeric and other values. > > > > Beside my personal opinion that storing different types of data in one > column is not the best idea, try: > > Select col1, col2, ..., > decode (other_column, > value_meaning_col_is_number, num(col), > 0) <--- or any other value for > non-number-values > > see > http://dev.mysql.com/doc/maxdb/en/cf/63316bc03511d2a97100a0c9449261/fram > eset.htm > > Elke > SAP Labs Berlin > Ok, the above I did not test, try this (tested) CASE WHEN other_column = value_meaning_col_is_number THEN NUM(col) ELSE 0 END Elke SAP Labs Berlin > > Is this possible? > > > > Greetings, > > > > Sander. > > > > > > -- > > MaxDB Discussion Mailing List > > For list archives: http://lists.mysql.com/maxdb > > To unsubscribe: > http://lists.mysql.com/maxdb?unsub=elke.zabach@xxxxxxx > > > -- > MaxDB Discussion Mailing List > For list archives: http://lists.mysql.com/maxdb > To unsubscribe: http://lists.mysql.com/maxdb?unsub=elke.zabach@xxxxxxx -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=gcdm-maxdb@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: MaxDB problems working in ORACLE mode with embedded SQL in C/C++ programs (details), Simenec, Thomas |
|---|---|
| Next by Date: | Does someone tried HotStandby on Linux/Unix?, |
| Previous by Thread: | Re: AW: [SQL question]: type checking/conversion, sander hofstee |
| Next by Thread: | Problem with Transaction Log SAPDB, nerec79\@libero\.it |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|