首页 \ 问答 \ 使用Oracle中的Select Satement中的Case返回多个列(returning multiple columns using Case in Select Satement in Oracle)

使用Oracle中的Select Satement中的Case返回多个列(returning multiple columns using Case in Select Satement in Oracle)

我有一个场景,我需要根据主选择语句中的条件从不同的子查询中检索值。 我试图使用Case,但问题是Case不支持多列。 有没有解决这个问题的方法,或者是否有其他方法来达到这个目的?

我在一个简化的查询中的场景

select col1,col2,
case when col3='E01089001' then 
        (select 1,3 from dual)
    else
        (select 2,4 from dual)
end
from Table1
where col1='A0529';

I have a sceanrio where i need to retreive values from different sub queries based on a condition in a main select statement. i was trying to use Case, but the problem is that Case does not support multiple columns. Is there any work around to this, or is there any other way to acheive this.

My scenario in a simplified query

select col1,col2,
case when col3='E01089001' then 
        (select 1,3 from dual)
    else
        (select 2,4 from dual)
end
from Table1
where col1='A0529';

原文:https://stackoverflow.com/questions/700658
更新时间:2024-05-05 06:05

最满意答案

您可以获取数据,然后一旦拥有数据,只有拥有数据,您是否使用ReactDOM.render。

它不会阻止加载页面,并且您的css将会应用,在这里就不会有任何内容。


You can fetch the data, and then once you have it, and only once you have it, do you ReactDOM.render.

It doesn't stop the page from loading and your css will apply, there just won't be any content in body.

相关问答

更多
  • 从异步github页面: eachSeries (arr,iterator,callback) 与每个相同,只有迭代器被应用于arr中的每个项目。 下一个迭代器只在当前的迭代器完成时调用。 这意味着迭代器的功能将按顺序完成。 所以假设你的节点中有XML 节点 async.eachSeries( nodes, // This will be applied to every node in nodes function (node, callback) { models('hs').fin ...
  • 其实,权限并不是这个问题的原因。 由于Realm不正确的线程,我有'InvocationTargetException'。 但为什么错误是'权限被拒绝'对我来说仍然是一个难题。 Actually, permissions were not the cause of this issue. I've had 'InvocationTargetException' because of Realm incorrect thread. But why the error was 'permissions deni ...
  • 永远不会获得数组的最简单方法是始终使用字符串作为键。 如果您的自然键是数字,则用字符串作为前缀。 例如 var words = ['zero', 'one', 'two', 'three']; words.forEach(function(word, index) { ref.child('word_'+index).set(word); }); 这样你最终会得到: { "word_0": "zero", "word_1": "one", "word_2": "two", "word_ ...
  • 你的第一个then()不会返回任何东西,所以第二个then()将立即触发,这是你在控制台中看到的。 但是请求循环是异步的 ,尚未完成 创建一个承诺数组并使用Promise.all()这样第二个then()将不会触发,直到循环中的请求全部完成。 export const fetchAccounts = () => { return (dispatch, getState) => { const accounts = []; const uid = getState().auth. ...
  • Firebase是一个云托管数据库。 这意味着从数据库获取数据需要通过网络建立(或发送数据)。 因此,没有方法可以从Firebase同步加载数据。 如果你想解决这个问题,请看看这个问题: 强制异步Firebase查询同步执行? 。 但我强烈建议您接受使用Firebase的异步性质。 如果您这样做,您的用户将不胜感激。 Firebase is a cloud-hosted database. This means that to get data from the database requires esta ...
  • 您可以使用FIRDatabase.database().reference()来获取通过FIRApp.configure()加载的数据库的引用。 You can use FIRDatabase.database().reference() to get a reference to your database that was loaded via FIRApp.configure().
  • 这是addListenerForSingleValueEvent()的预期行为。 如文档所述: 它被触发一次然后不再被触发。 除非你的目标是不同的东西? 我误解了你帖子里的内容吗? 你的目标是你只是听一个特定的单一价值吗? 如果是,我认为你应该使用addValueEventListener()代替。 编辑: 以防其他人看到这一点。 这是addListenerForSingleValueEvent()的最新文档链接。 That is the intended behavior of addListenerFo ...
  • 关于异步编程的一点是,它起初并不直观。 如果你想获取一些数据,想编写这样的代码是很自然的: try { result = database.get("the_thing_i_want") // handle the results here } catch (error) { // handle any errors here } 这是一个同步调用,它简短易懂。 get()的结果直接从函数返回,调用代码正在等待它完成。 但这正是问题所在。 你不希望你的代码停下来等待可能需要很长时间 ...
  • 您可以获取数据,然后一旦拥有数据,只有拥有数据,您是否使用ReactDOM.render。 它不会阻止加载页面,并且您的css将会应用,在这里就不会有任何内容。 You can fetch the data, and then once you have it, and only once you have it, do you ReactDOM.render. It doesn't stop the page from loading and your css will apply, there just ...
  • 我想你正在寻找:我怎么知道没有与我的查询匹配的生日? 在这种情况下,您需要监听value事件。 如果使用once()附加它,则无论是否有结果,当您附加查询时它都会立即触发。 admin.database().ref("calendar/birthday") .orderByKey().startAt(key).limitToFirst(1).once("value") .then(function(snapshot) { if (!snapshot.exists()) { con ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)