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
Can Ping host name but not Browse
Windows 7 Offline File Sync issues - Location is not available: The file is currently not available for use on this computer.
Windows 7 profile won't delete completely
1 server, 2 NICS and 2 different gateways
Dell Poweredge 1800 SBS 2003 reboots at 'Applying Computer Settings'
Wyse thin client and Citrix display/graphic lag
Blocking messages from a specific sender or domain in Exchange 2010
Check if EJB is invioked
IE8 - minimized windows - same url - change names
Microsoft Access: Creating a payment system.