I have sqlite database with table containing comma seperated fields like that: Data Field containing: Frank; 34 California street; 0123456789 FieldData Field containing: Name; Address; Phone …
Tag: sql
grouping rows while being able to show columns from each row in the group
I’m sure the title is not clear enough, couldn’t find a better way to explain what I need. I’m using PostGreSQL 11.4 i’ll minify the problem i’m having to show the actual issue. I have a query that …
Postgresql tuple constraints about NOT NULL
I am building a database in POSTGRESQL, and I would like to create NOT NULL constraints for my columns, where one and only one column would be NOT NULL. I have two columns in my table, site_id and …
Select only rows that satisfy 60% of the where clause – SQL Server
I am facing a challenge in SQL. I have the following query: SELECT * FROM Books WHERE Categories IN (‘Fiction’, ‘art’) OR Language IN (‘en’, ‘de’) OR Country = ‘DE’ I need to look at …
sqlite return same value on left join
in below my sqlite command i want to get count of barcoeds when that’s equals with sessions.id select sessions.id, sessions.session_name, sessions.session_type,sessions.date_time, count(barcodes.id) …
SQL Function: Get next value in row
I’m looking for an SQL way to get the value from the next row. The data I have looks like: CURR_STRT_DT CUUR_END_DT product 6/30/2019 9/28/2019 A 6/30/2019 9/28/…
float to string no scientific notation: SQL Server
Have a problem with some wonky ID’s that I can’t quite figure out. The above is a result of joining two tables, where ID1 = ID2. ID1 cannot be null, however ID2 can be null. What I’m attempting to arrive at is: So I can then drop the other column. I’ve tried casting, str function, remo…
How to get particular object from jsonb in PostgreSQL?
I have a table called ‘Test’ that holds two fields ‘qnId’ and ‘Answers’. ‘qnId’ stores a uuid and ‘Answers’ is a jsonb array that roughly looks like this: [{ “user” : “1”, “ans” : “some text” }, { ̶…
SQL server error in regards to common table expression [closed]
I have this query: if object_id(‘tempdb..#mappings’) is not null drop table #mappings; Create table #mappings ( GLEntity int, NoteOwner VARCHAR(MAX) ) INSERT INTO #mappings VALUES(351, ‘Ajax …
Error when using function: The used SELECT statements have a different number of columns
In my MySQL database I have defined a function called isUserVerified that return the status of a user. I am trying to use the function in a SQL statement: SELECT id, isUserVerified(id) AS …