Questions tagged [clause]

252 questions
0
votes
4 answers

SQL - Removing Duplicate without 'hard' coding?

Heres my scenario. I have a table with 3 rows I want to return within a stored procedure, rows are email, name and id. id must = 3 or 4 and email must only be per user as some have multiple entries. I have a Select statement as follows SELECT …
DtotheG
  • 1,277
  • 5
  • 21
  • 35
0
votes
2 answers

DCG(Definite clause grammar) in Prolog

I am trying to make a DCG in prolog so that I create a sentence based on some predicates. I have two pieces of information = properties of objects ("Charles is a man.") and relations between objects ("Charles is the father of William.") The task is…
user1306283
0
votes
2 answers

Building a WHERE clause programmatically, then passing it into SQL as a parameter

On my asp.net project, there are instances where a server side filter function in C# is building an SQL WHERE clause, then passing it into an SQL stored procedure for example, Filter produces a string variable with a value like “WHERE Qty < 5 AND…
0
votes
1 answer

Prolog - return whole clause

I have some basic formulas like female(camilla). female(diana). ... parent(person, child). ... and predicate language/2 that specifies which predicates will I be using: langugage(female, 1). language(parent, 2). What I have to do is to create…
Smajl
  • 7,555
  • 29
  • 108
  • 179
0
votes
2 answers

How to specify target table for update in FROM clause for MYSQL?

My script-: UPDATE catalog_product_price SET catalog_product_price.value = 200 WHERE value_id = ( SELECT value_id FROM catalog_product_price WHERE `entity_id` = ( SELECT `entity_id` FROM `catalog_product_entity` …
Prat
  • 519
  • 5
  • 16
  • 33
-1
votes
1 answer

Where IN Clause not working when given with a subquery

I have a query select comma_separated_asin from temp.asin_workbench_filtered which gives out COMMA_SEPARATED_ASIN 'B098GJ3K6Z','B08Q26RV4D' I have another query select distinct asin, ordered_revenue, report_date from …
-1
votes
2 answers

How many elements in one column are linked to an element other column?

Consider I have two tables Courses Program --------------------------- course_ID program_id course_title program_name program_ID Now, I want to check no of courses(by course_id) offered by each program…
-1
votes
1 answer

Strange behaviour of IN clause in Cakephp 2.8.2

I have created multiple checkbox as follow. $forms = $this->wondr->m('WApplication.ApplicantForms')->find('list', array('conditions' => array('facility_id' => $this->wondr->facility['Facility']['id']), 'contain' => array())); …
Sehdev
  • 5,486
  • 3
  • 11
  • 34
-1
votes
1 answer

How access SQL values in a Group clause with an Mysqli Prepared Statement

I'm trying run a prepared statement using mysqli. $stmt = mysqli_stmt_init($connection); mysqli_stmt_prepare($stmt, "SELECT books.book_id, title, publish_date, thumbnail, GROUP_CONCAT(CONCAT(authors.author_id,' ', first_name,' ', last_name)) FROM…
codeman
  • 11
  • 4
-1
votes
1 answer

PHP - Is there anyway to set error reporting levels such that single-statement inline clauses are flagged, at least with a warning

I've searched for this but it is a difficult issue to concisely search. I believe in strict language requirements and error/warning reporting. I run PHP with All and Strict error reporting enabled. If a error or warning is generated, I fix the…
SimonT
  • 486
  • 1
  • 4
  • 16
-1
votes
3 answers

Is there a way to check if the min and max values of a table are equal to each other in SQL/Postgres?

Say a column is: Price $3.00 $3.00 The min and max would be equal. Is there a way to check for that in the WHERE clause?
Ricky Su
  • 295
  • 1
  • 7
  • 10
-1
votes
1 answer

How to Use IN Clause as well as AND clause in SQL together

SELECT * FROM `Events` WHERE `UserID` IN (SELECT `BeingFollowed` FROM `Followers` WHERE `Follower` = us) Ok so above is my query and i'm trying to get all the events made by my followers and the us variable is a parameter in a stored routine…
Andrew Edwards
  • 1,005
  • 1
  • 9
  • 24
-1
votes
1 answer

Selection Of data using "as" clause Using JPA

As I know, using SQL we can select the data with customised form like the query below: select ' I have tried many…
ravinder reddy
  • 309
  • 1
  • 4
  • 17
-1
votes
1 answer

Update query with max function with where clause

I have been trying to get through with the following query: UPDATE transactions SET proposal= MAX(proposal) + 1 WHERE id =1054 But it shows error. Can anyone help me?
-1
votes
3 answers

SQL UPDATE statement

I have two tables - room and roomBooking which include; room rCode | rName | building | capacity | disabledAccess Text | Text | Text | Number | Yes/No roomBooking bookingID |…
Laura Berry
  • 89
  • 2
  • 12
1 2 3
16
17