Microsoft
Software
Hardware
Network
Question : How to make the query with random characters?
Have a table A (ID varchar2(5)) and a list of words: ABC, VBD, DBC.
A
---------
23453
34567
76541
67862
....
Want to get the result like:
23453 DBC
34567
76541 ABC
67862 VBD
That is when the last digit is 1, get the 1st word ie ABC, when 2, get 2nd word VBD, and when 3, get DBC. The rest is NULL.
Related Solutions:
How to write sql statement s involve two tables in order?
Answer : How to make the query with random characters?
Hi,
You can try this query.
1: 2:
SELECT id, DECODE(TO_NUMBER(substr(id,-1)), 1, 'ABC', 2, 'VBD', 3, 'DBC', NULL) FROM a
Random Solutions
How do I use a volume license key on a HP computer with restore CD
Computer playing random ads without any open windows
In Perl, how do I add a value to the list, then check to see if the value exist before adding a new value
MS Excel 2007 & PDF - Exporting to PDF takes long hours!
Is there a page limit for crystal reports for export to pdf
Computer reboots severat times a day
server name
Record pone calls in remote desktop
how to make vlookup work
Perl Iteration issue