where-clause

How to sum up different property weights?

守給你的承諾、 提交于 2019-12-08 11:01:59
问题 I am trying to get two properties sum (with weight) and combine them finally into a combined weight. So, first the separate queries, so you can see the correct sum weights Language = French , Proficiency over 6 (scale 1-10): MATCH (User)-[Speaks]->(Language) WHERE Language.language = 'French' AND Speaks.proficiency >=6 RETURN User.name, SUM( CASE WHEN Language.language='French' THEN Speaks.proficiency*3 END )*0.1 AS TOTAL_Language ORDER BY TOTAL_Language DESC User.name TOTAL_Language David 3

Dynamic LINQ Multiple Where Clause

最后都变了- 提交于 2019-12-08 07:03:04
问题 Still really struggling with this and appear to be going round in circles. I have the following code that is driving me nuts. It should populate a list of items to be used in an autocomplete text box: public string[] GetAutoComplete(string prefixText, int count) { string memberid = HttpContext.Current.Session["MemberID"].ToString(); string locationid = HttpContext.Current.Session["LocationID"].ToString(); string inhouse = HttpContext.Current.Session["Inhouse"].ToString(); string supplier =

Applying Where clause for Order by in SQL

自闭症网瘾萝莉.ら 提交于 2019-12-08 05:57:45
问题 Would like to sort the following data the way allows in the order of choice of keywords based on like clause: Data in table: EmpId EmpLotusNotes 10001 Amit B/India 20002 Bharat C/India 30003 Kyo Jun/Japan 40004 Jee Lee/China 50005 Xavier K/USA Data to be presented/sorted based on certain country order (Japan, China, India, USA): EmpId EmpLotusNotes 30003 Kyo Jun/Japan 40004 Jee Lee/China 10001 Amit B/India 20002 Bharat C/India 50005 Xavier K/USA Note: I cannot create another table that holds

Referring to a python variable in SQLite3 DELETE statement

给你一囗甜甜゛ 提交于 2019-12-08 05:57:33
问题 I am writing a function to delete a record from a table. The variable I am trying to refer to in the delete statement is a Tkinter entry field. I get the variable using the .get() method, but I can't then pass this into the SQLite statment without returning an error. The following code is part of the frame, I've only added the relevant code to the problem from tkinter import * import sqlite3 class EditOrdersForm(Frame): def __init__(self): Frame.__init__(self) self.master.title("Edit Orders

How would I improve this 7 line Linq Query that acts as a Specification?

家住魔仙堡 提交于 2019-12-07 15:58:53
问题 BigQuery at the top gets a set of Products and nested related tables. Then, I apply filtering in a poor attempt at a specification pattern. This is the filter code. There are three tables in the query, and I want to filter the top query by the value nested in the bottom query. Like I said, this currently produces the results we want. However, the .Contains() produces a SQL WHERE EXISTS() clause for each. We really only need one, but I don't know how to get the inner ID to compare with the

How can I prevent the LinqDataSource Where clause from resetting on postback?

拈花ヽ惹草 提交于 2019-12-07 14:47:46
问题 I'm trying to set the where clause on a LinqDataSource object bound to a GridView programmatically on a button click, but when the GridView rebinds data (for instance, when the user sorts) the Where clause resets back to the empty string. Is there a way to prevent this, or is there a better way to filter my results? 回答1: Perhaps you just add a ViewState property into your page/user control and then retrieve it on all post back? public string MyLinqSourceWhere { get { return (string)this

Jquery query XML document where clause

送分小仙女□ 提交于 2019-12-07 13:05:52
I have an XML document that I want to search a specific date and get information for just that date. My XML looks like this: <month id="01"> <day id="1"> <eitem type="dayinfo"> <caption> <text lang="cy">f. 3 r.</text> <text lang="en">f. 3 r.</text> </caption> <ref href="link" id="3"/> <thumb href="link" id="3"/> </eitem> </day> <day id="7"> <eitem type="dayinfo"> <caption> <text lang="cy">f. 5 v.</text> <text lang="en">f. 5 v.</text> </caption> <ref href="link" id="4"/> <thumb href="link" id="4"/> </eitem> </day> <day id="28"> <eitem type="dayinfo2"> <caption id="1"> <text lang="cy">test</text

Where Clause Applied To Multiple Patterns

梦想的初衷 提交于 2019-12-07 11:11:04
问题 I have a function with multiple patterns. I have two or more of them which share the same expression which I want to replace. Now if I write a where clause at the bottom, indent it and define a new variable as the expression I wanted to replace it won't work. Example: myFunction firstParam secondParam = expression myFunction firstParam _ = 1 + expression where expression = firstParam + secondParam Compiler message: Not in scope: `expression' Not in scope: `secondParam' How do I do it? 回答1:

Dataframe where clause doesn't work when use spark cassandra connector

旧巷老猫 提交于 2019-12-07 04:06:28
We use python spark cassandra driver V3.0.0. from datastax When try to load data by using dataframe, the where clause doesn't work. However the CQL itself does work in Datastax DevCenter. The code looks like this dataf = sqlc.read.format("org.apache.spark.sql.cassandra")\ .options(table="tran_history", keyspace="test")\ .load()\ .where("usr_id='abc' log_ts >= maxtimeuuid('2016-02-01 10:09:26-0800')")\ .collect() It seems the driver doesn't recognize method maxtimeuuid ------------------Below is the error File "C:\Spark\spark-1.4.1-bin-hadoop2.6.2\python\lib\pyspark.zip\pyspark\sql\dataframe.py

using mysql variable to hold comma separated value to be used for where in clause

僤鯓⒐⒋嵵緔 提交于 2019-12-07 03:24:07
问题 I have to run a query like this (query 1) - select something from sometable where someId in (1,2,3) I would like to keep a variable for the IDs part, like this (query 2) - set @myIds = "1,2,3"; select something from sometable where someId in (@myIds); But this does not give the expected result (gives an empty result set), and no query error as well. I checked that if I wrap the comma separated IDs inside quotes, the query results an empty result set (query 3) - select something from sometable