Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
102 views

I have two tables. They each have around 2.3 million rows in them. They are running on PostgreSQL 17.4 CREATE TABLE keyeddata ( category text NULL, key1 text NULL, key2 text NULL, key3 ...
Tim B's user avatar
  • 41.3k
1 vote
2 answers
217 views

CREATE TABLE foo ( id SERIAL PRIMARY KEY, a TEXT, b TEXT ) Column a can take a value only when column b is empty and vice versa: id | a | b ---+-------+------ 1 | NULL | 'abc' 2 | '...
Prosto_Oleg's user avatar
1 vote
1 answer
95 views

When I use the Oracle PHP function oci_bind_array_by_name(), it converts all nulls in my array to 0s for any number fields and 0-length strings for varchar2s. The official documentation does not ...
TooManyCooks's user avatar
-1 votes
1 answer
25 views

I created a table called "Author" and inserted row values into it in MySql. When I query the table with SELECT * FROM Author; the result will show the columns but not row values. I assume I ...
vinny's user avatar
  • 9
1 vote
3 answers
82 views

I have a table where I want to find the average value of column1 and column2, but in some cases there may be null values in either columns. In that case, I just want to be shown the value that is NOT ...
Kaato's user avatar
  • 13
-1 votes
1 answer
89 views

I have a schema in a read-only Oracle database called MAXSCHEMA and a table in it called WORKORDER. This table has a column called WONUM. If I use this SQL statement: SELECT * FROM MAXSCHEMA.WORKORDER ...
Jim Higgins's user avatar
0 votes
0 answers
77 views

I am creating an update query string in Bizagi, that will be passed to SQL Server to be executed. The update values are taken from a Bizagi form, and may or not be NULL. The string includes boolean, ...
MickO's user avatar
  • 1
0 votes
1 answer
176 views

I have a PostgreSQL query for a time series graph with an inner join. A list of tags is used as a where condition for the inner join. I use union all to get a result table with data from two cases: a ...
jvkloc's user avatar
  • 936
0 votes
1 answer
199 views

I am currently trying to get the number of months between 2 dates in Oracle SQL, however when the end date is null then it comes up with null, is there a way to use todays date if end date is null in ...
Katrina's user avatar
0 votes
1 answer
84 views

I have a problem that in Postgres 14 a NULL check on my UDT does no longer work after I modify the type. My composite UDT that has two attributes. create type A as ( foo text ); create type B as ( ...
Antigo's user avatar
  • 335
0 votes
1 answer
56 views

i want to sort with SQLITE so my data will show like this: First sort by year asc, then alphabetic If year is null then alphabetic desc My ideas was : ORDER by CASE WHEN year = NULL then Name Else ...
Mikkey200's user avatar
0 votes
1 answer
133 views

I use json format to send the data, here is the fragment of my code which returns an error def blocks_files(self, db, order_id, op_id, file_ids, images): """Creating record ...
SomeRandomDude111's user avatar
-1 votes
1 answer
82 views

I am trying to pull store data for locations in the US and around the world. select s.store, s.store_name, s.store_city, s.state, st.description as "STATE_DESC", s....
Aly S's user avatar
  • 9
-3 votes
1 answer
64 views

Can anyone explain why Last_Value does not take the last value (which is last as per order by) for all rows ? select * from mytableone Initial Data (Please click on link) Query Used: select t.*, ...
Aswin K's user avatar
0 votes
1 answer
59 views

SQLAlchemy ORM generally turns instance attributes that are None into NULL column values in the database (and vice-versa), but I'd like SQLAlchemy to convert between None values in the ORM and a ...
jkmacc's user avatar
  • 6,597
1 vote
1 answer
206 views

I have a snowflake table (called as original_table) with following fields case_num, code, project_name, sp_id, updated_date. For each case_num the combination of code, project_name, sp_id will be ...
Data Rish's user avatar
0 votes
1 answer
111 views

I'm writing a PostgresQL C extension and I'd like to call a sql function that can possibly return null value. I cannot use DirectFunctionCall family of functions, because they raise an error when ...
Serpent7776's user avatar
0 votes
2 answers
70 views

I am trying to query a list of rows from the database. It has 7 fields (columns) (A,B,C,VA,VB,VC,LISTED). SELECT * FROM datas WHERE ((A=1 OR A IS NULL) AND (B=1 OR B IS NULL) AND (C=1 OR C IS ...
user3916429's user avatar
0 votes
1 answer
55 views

My Tables are able follows Table name: Student NAME STATUS Jason X John NULL Table name: Status STATUS DESCRIPTION X Active NULL Inactive I cannot get the expected results when I join the 2 tables ...
Jason Joel Pinto's user avatar
-2 votes
1 answer
352 views

I am currently learning SQL and I am doing a SQL assignment with the following scenario: Select the FirstName and LastName for Artists who were born in Canada or the UK. Replace any artists last name ...
user avatar
0 votes
2 answers
2k views

I have 3 tables in a database A, B and C which share the same column "name". B has an attribute "title" and C has an attribute "age". I am looking to write a SQL query ...
bluestacks454's user avatar
0 votes
1 answer
50 views

I want to find the nearest coordinates to validate the place name as the format type is FLOAT, then I cannot use LIKE function as it is only applicable for STRING format. situation example; my ...
Syarqawi Ruslan's user avatar
1 vote
1 answer
46 views

While trying to isolate the 7 rows in the first query below, I got results that, as a novice, I was not expecting. I read over this SQLite document but do not understand why the 7 rows which are NULL ...
Gary's user avatar
  • 3,224
0 votes
0 answers
134 views

We are trying to implement the ability to search across multiple (or all) columns on joined tables in our database, but with the requirement that an arbitrary number of columns can actually be left &...
trn_is's user avatar
  • 1
3 votes
3 answers
116 views

I am trying to calculate the percentage of the row events when the value is null. I have a table with 2 rows (zip_code, events). TABLE weather events TEXT zip_code INTEGER This is the query I ...
serafm's user avatar
  • 59
0 votes
1 answer
28 views

How do I fix my IFNULL so that it doesn't break the below? If I remove the IFNULL than it works fine, but I need to calculate data off that column and need to get rid of the null values and replace ...
emily porter's user avatar
1 vote
1 answer
145 views

Here is the code: WHERE 1=1 AND TU.Auction_I IN (41, 42) AND @StatePickupID = CASE WHEN @StatePickupID IS NOT NULL THEN (UP.TransportStateID = @StatePickupID) END ...
CrankySwan's user avatar
-1 votes
1 answer
45 views

I have a LOT of junk columns in my table containing thousands of null values and maybe one or two real values. I would like to select only the columns in this table containing more than 10 non-null ...
D.M.'s user avatar
  • 1
0 votes
0 answers
203 views

I have data that I am using df.to_sql() on to get into my postgres warehouse. I have used the following answer to handle the same error, but now all nulls are inputted as nan in my tables. Below is ...
Ethan's user avatar
  • 544
0 votes
1 answer
83 views

I'm having trouble formatting this result set. The columns vendor_address1 and vendor_address2 have the text NULL in them. I need to format the output like the picture. I have tried various case ...
fice's user avatar
  • 23
1 vote
1 answer
186 views

I am having trouble adding a percent sign to the output of the NVL() function. If you look in the desired output picture you will see that the commission needs to have a % added to it. I've tried ...
fice's user avatar
  • 23
1 vote
1 answer
682 views

I'm making some simple PostgREST queries on a table with network device properties. It seems that eq and not.eq both exclude null values. I've learned that that's a “feature” of PostgreSQL, and can be ...
Jacktose's user avatar
  • 763
3 votes
1 answer
671 views

I want to check if certain column exists after AND statement and if it does, add another AND statement. What would be the best way to achieve this? For example: SELECT * FROM db.table AS t ...
passionateLearner's user avatar
0 votes
1 answer
921 views

I have a query that works as intended, and I need to build upon it to include a new column that has conditional values. The new column will result with either a date or a string 'na'. To accomplish ...
latestnight's user avatar
0 votes
1 answer
160 views

I have a form that takes data from a database, I want to convert the data from null to a value of 0 in case there is no row in the database, I tried a lot but did not find the solution { con....
المدار للانترنت's user avatar
0 votes
1 answer
90 views

SELECT emp.`emp_id`,cio.`pin`,cio.`checktime` FROM payroll.employees AS emp LEFT JOIN (SELECT * FROM zkteco_biotime.checkinout WHERE checktime > "2022-09-20 23:59:59") AS cio ON emp....
Saqibuddin Siddique's user avatar
-1 votes
1 answer
72 views

I have two php files to bring up a database in a particular order, but what I need is for the columns that are empty to be omitted. the file on the web page is: <?php if(is_array($fetchData)){ ...
fiddler's user avatar
1 vote
2 answers
2k views

I have two tables as shown below t1: cust_id product score 1 bat 0.8 2 ball 0.3 2 phone 0.6 3 tv 1.0 2 bat ...
Danish's user avatar
  • 2,911
0 votes
0 answers
511 views

I have a Spring Boot application with Kotlin and want to store the creation timestamp and the last updated timestamp. The following code should do the trick: @Entity data class Entity( // ... ) { ...
Ian Fako's user avatar
  • 1,250
1 vote
2 answers
69 views

If I have the following table name nationality AAA french BBB english CCC spanish DDD dutch BBB NULL AAA NULL How do I update the NULL values with 'english' and 'french' respectively I tried the ...
HJA24's user avatar
  • 406
1 vote
1 answer
517 views

I was loading some text data into Apache Hive containing int columns. It was storing null values at unexpected places. So, I ran some tests: create table testdata (c1 INT, c2 FLOAT) row format ...
Sourav Kannantha B's user avatar
0 votes
2 answers
2k views

select * from test; select * from test where name not in ('amtf'); Why?
Zuojia Jiang's user avatar
2 votes
2 answers
99 views

I have a table that contains a group number column and a data column: GROUP DataColumn 1 NULL 1 NULL 1 "hello" 1 NULL 2 "bye" 2 "sorry" 3 NULL 3 NULL 3 NULL I want to ...
Runtime Terror's user avatar
1 vote
3 answers
139 views

I'm doing a query across databases with an identical structure, to show a mapping from a source value to a target value. Every one of my databases has a table with two columns: source and target DB1 ...
Geert Bellekens's user avatar
2 votes
0 answers
2k views

In general, it is a good practice to use "created on" and "updated on" columns for SQL database tables for traceability reasons, exact we you have some other way of tracing the ...
user2340939's user avatar
  • 2,021
1 vote
1 answer
98 views

The SQL standard (SQL:2011 draft, p. 363) says that when two tables are joined with USING, the result has only one column named c for each c (called a corresponding join column) specified in <join ...
ByteEater's user avatar
  • 1,201
0 votes
2 answers
2k views

I am trying to enter data into my database, but some fields are being entered as NULL Here is fields of my Model class on Spring @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; ...
Shlok Sharma's user avatar
0 votes
1 answer
2k views

I added Person as a foreign key to the CareerHistory table. person = models.ForeignKey( Person, on_delete=models.PROTECT, default=None, related_name='careerist') I set default=None thinking ...
Malik A. Rumi's user avatar
-3 votes
3 answers
2k views

Given I have two SQL tables: movies ---------------- | id | title | ---------------- | 1 | Matrix | | 2 | Titanic | ---------------- directors ----------------------- | id | name | ...
corgrath's user avatar
  • 12.4k
4 votes
2 answers
3k views

We have a case in Postgres where where p.is_ready_for_submission != 'N' is failing to include NULL as a satisfying value for this condition. The column is_ready_for_submission can be NULL, Y, N. The ...
gene b.'s user avatar
  • 12.7k

1
2 3 4 5 6