使用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
最满意答案
您可以获取数据,然后一旦拥有数据,只有拥有数据,您是否使用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 ...
-
RxJava和Firebase数据库(RxJava and Firebase database)[2023-06-24]
其实,权限并不是这个问题的原因。 由于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 ...
-
iOS Firebase数据库URL(iOS Firebase Database URL)[2022-09-05]
您可以使用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 ...