It may look like a duplicate of existing questions (e.g. This one) but they only deal with passing “new” arguments, not selecting rows from the database. I have a table, for example: And a function: I would like to run it on data already existing in the database. It’s no problem if I would l…
DB2 SQL: How to ‘count’ the amount of records returned by a having clause
Table XRDK/WHSHIPP_R3 has 4 columns – ZNWHSE, ZNSITE, ZNMANE, ZNRECD with a total of 1,071 records. I have isolated the ZNMANE numbers that have been used more than once by; SELECT ZNMANE FROM XRDK/…
Remote connection to MS SQL – Error using pyodbc vs success using SQL Server Management Studio
I have a MS SQL database in the same network but in other computer. Using the SQL Server Management Studio (SSMS) Express, I can find the database and connect without problems. But when I use pyodbc to connect to the same server using: I get following error: OBS: I guess that the server string should be right…
how i can select records with varbinary type?
I have table in my database that has two column namely data and length. I declare data as a VARBINARY(MAX) and suppose the table has a record with length equal to 5 and data = 0x23 0x00 0x12 0x45 0x34. Table definition: The question: Is it possible to search (with a SELECT query) to find records that has 0x00…
Why does this simple query not use the index in postgres?
In my postgreSQL database I have a table named “product”. In this table I have a column named “date_touched” with type timestamp. I created a simple btree index on this column. This is the schema of my table (I omitted irrelevant column & index definitions): The table has ~300,000 …
How do I group “or” in pl/sql
I have legacy sql query that selects bit masks (among other data), something like: How do I group this output like: That should be 3 Answer In order to do bit-wise logic you have to do a “bit” of math. (Bad puns are free around here :-). Oracle defines the BITAND function. To get a bitwise ‘…
How to set transaction isolation level as read uncommitted as default for users
Is it possible to set the transaction isolation level to read uncommitted for users by default in MS SQL Server Management Studio 2012? I was thinking it could either be done through editing a …
How to use SQL databases in python without writing SQL?
I’m looking for a way to use a SQL database (such as MySQL, SQLite) in python without actually writing SQL. Example would be something like this (pseudocode): # INSERT INTO table (firstname, …
How to update ms access database table using update and sum() function?
I have Two tables in my access database table1(ID,productname,qunatity,remainder) table2(ID,productname,sales) these tables are related together using “product name” ,How can I update”reminder” from table1 with the value of “quantity form first table – Sum(sales) from secon…
Understanding T-SQL GOTO
My teacher recently talked about the statement ‘GOTO’, to be used in Management Studio, but I didn’t quite understand it at first. He stated that GOTO is being used to jump to different pieces of code,…