Skip to content
Advertisement

Tag: where-clause

In the SQL Query I couldn’t get truly data

Hi, I have a facilities table. I want to know which hotel_id has 2 facilities at the same time. with that no record. Answer Your query does not work because you are looking for rows that satisify both conditions simultaneously, which cannot happen. You need to look across rows of the same group. Instead, you can filter on rows that

get null values with decode

I have a table with names, where the name can be null. If I want to get all the rows with null names, I do the following: but I want to make sure that if I specify a value it will get the non-null values and if it won’t get the null values So I get the values that are

Comparing two dates in Oracle after using TO_DATE function

I have the following Oracle Query that is converting todays date and the date field from the table into the same format. However, when trying to compare the two they aren’t coming up as equal. The cast is used on the field in my table, both these return. However, when adding the following where statement no rows are returned. I

Difference between NVL and OR in SQL oracle

Hej guys, could someone explain to me difference between NVL() and OR in below query : Number of rows: 44937 and Number of rows: 44782 Why we have this difference: 155 rows? i built a few query based on nvl and notice that issue and going to switch to OR, but I really want to know, why it such a

Multi-parameter search with mysql and node.js

Let me preface by saying I’m very new to SQL (and back end design) in general. So for those annoyed with noob questions, please be gentle. BACKGROUND: I’m trying to build a product test database (storing test data for all our products) where I want a user to be able to refine a search to find test data they actually

Conditional Query Using “AS” field

Above you can see my code. It is currently returning exactly the output I want when you remove the “WHERE” function. I’m adding the “WHERE” function and attempting to access the new column I made called “NPO”. It seems as if the column does not exist to the SQL editor, but it does exist when the query is ran. How

Advertisement