I have a shape file that I have imported in to MSSQL as a table with a geometry column. The geometry column is essentially the outline of the UK coastline. What I have been asked to do is to be able to supply latitude/longitude and calculate the closest distance to the coast I have established that the proble…
Tag: sql
There is already an object named ‘#tmptable’ in the database
I´m trying to execute stored procedure but I get an issue of an existing temporal table, but I just create one time and use into another part of code SELECT … INTO #tmpUnidadesPresupuestadas FROM …
INSERT INTO table SELECT not working with constant values in H2 DB
Following is the H2DB query What I am trying to achieve is to insert a record into userpermission for user with given email address in user table, for each permission in permission table. Following is the error The same query is working in MySQL. Answer As mentioned in the comments, Use single quotes for stin…
php add a counter in while loop and return to a new line when i reach this counter
this is my code: now this code works fine, but it echo my results on the same line since its a loop. i want my output to be 3 photos per line for example: image1 image2 image3 (jumps to line) image4 image5 image6 and not: image1 image2 image3 image4 image5 image6. To be more precise i want to add a
Hive Create table – When to use VARCHAR and STRING as column data type
I am trying to create a HIVE table. I am not sure when we use VARCHAR and when we use String. If we use VARCHAR then do we have to define length like we define in RDBMS as VARCHAR(10) Please help Answer VARCHAR was introduced in Hive 0.12.0 for more SQL-compliant behavior, such as SQL string comparison semant…
Average time difference by rows with different column value
I have done some searching for similar question, but with no luck. Sample table below. ID | MO | Serial | PiID | Part_Number | Timestamp 1 | F610320 | 1 | QC1 | 4A130015 | 2017-…
cx_Oracle: Error 933. ORA-00933: “SQL command not properly ended”: SQL command error?
Similar questions have been asked before but I’ve still been unable to identify a solution for this. My code: try: connection = cx_Oracle.connect(ORACLE_CONNECT) logger.info(“…
Comparing TIMEDIFF in MySQL
I have these following data: and the following query that I want to use to find all the entries where the timediff is lesser than 50 hours The second row should be returned because it’s lesser than 50 hours, but the first row, which the timediff is more than 50 hours keep returning as well. It returns a…
How to SELECT data from a postgreSQL INDEX?
If I created an index with following command: CREATE INDEX ixname ON tbname (id); Where ixname is the name of index, tbname is the table name for which the index is being created and id is the …
What is the difference between NOT and != operators in SQL?
What is the difference between NOT and != operators in SQL? I can’t understand the difference. I guess they are same. Answer NOT negates the following condition so it can be used with various operators. != is the non-standard alternative for the <> operator which means “not equal”. e.g…