I’m trying to create a procedure that inserts the data of a new lecturer, then shows the last 3 lecturers added. This is what my table (lecturers) looks like: And this is my attempt to create the procedure: Then I call the procedure with this data for example: However, ORDER BY does not seem to be doing…
Reading BLOB column in oracle table
I have a table tbl which has below columns: When I run below query it works fine: But when I run below it throws error: I mean to say, if I select only 1 blob column to read , then date filter works fine. But when I select both BLOB columns with date filter in where clause, it throws below
How to select 7 rows or more from select query? even if table is returning less than 7 rows
I want a script that gives me an exact 7 rows. For example, if my table returns only 2 rows then we have to add another 5 rows with all columns contains a null value. But if the table returns more than 7 rows then select all returned rows. Please Help! Answer Create a dummy table with 2 Fields Now
Custom cell button action to Download a file to the ‘downloads’ folder
so I have managed to build my custom cell which holds a button to download a file from my local database. somehow all seems fine but when i run and try to download, I get an sql error that there’s a …
How to get a continuous group of id
I’d like to increment an id by group, for each variation of an attribute with only 2 values. like this : result wanted I tried dense_rank() with window function but i only gives me 1 or 2 in grp column Answer You can use window functions to solve this gaps and islands problem. Her is an approch using la…
Using like or ilike to create SQL/ PLpgSQL function
I am trying to create function Animals (for convenience purpose) that takes first letter of an animal name and returns the whole name of the animal from the list e.g. C=> Cow, Cat… The problem I am facing is that the string after the like function is being treated as a string (I want it to be input).…
SQL Server : assistance with INSERT INTO
I have a problem where I need to create new entries in the SpecialOfferProduct table. I am applying my created discount (SpecialOfferID = 20) to all products that have an inventory greater than 1800 but I can’t figure out what I am doing wrong. this is my code. It’s from the AdventureWorks2012 dat…
informix 14.10 How to join three table for double mapping
I have 3 tables c1,map1,map2 like this: And the output should be such a table: If it was just table map1, the problem was simple Can anybody help? Answer On the face of it, this should do the job: Tested with this SQL to confirm the result: Output:
How to get data from Json to multiple column PostgreSQL
I want to extract many objects (not all object) in JSON but don’t want to type for every single thing like this: Here my DEMO show real data and case, how to extract to multiple columns and cast it to exact data type (float, integer) I refer this question, can I use json_to_record for this or other meth…
Optimal join from a column to the concatenation of those columns?
I have a table TableLHS with a column ObjInfo: which I would like to join to TableRHS, with columns: So the join here involves 1) dropping the leading zeroes from ObjNumber, and 2) concatenating the three columns in TableRHS together. My best shot at the join is: My current performance could use some improvem…