Skip to content

Tag: sql

Issue with SQL Server select statement

I need help with a select statement that I’m currently struggling with. The scenario is this: select * from mytable WHERE isActive=1 and if only id is provided, select everything where the id=@id if firstname and lastname is provided, then select everything where firstname=@firstname and lastname=@lastn…

Unable to import all values from google sheets to sql

I’m trying to import data from google sheets to mysql. I saved the google sheet as .csv. One of the columns square_feet has very few entries so there are a lot of blank cells. I am unable to import any row which has those blank cells. The error I’m getting is. #1366 – Incorrect integer value…

Replacing certain characters of string in column (MySQL)

I have a table in a MySQL database that features a ‘name’ column with values such as: SDP3973455/1 101390375/2 SDP4608677 105859492/1 104295947 As you can see, some values have the characters ‘SPD’ in front and some values have ‘/1 or /2’ at the end of the string. I want to…

Is that possible that access to a sql table with question mark?

I have 3 sql tables customer, employee and manager. I want to access dynamically to my tables. I had a statement like this, But in this situation i can only access to customer. I need to access all of the tables for different operations. Is that possible to write this, or what can i do to access for example e…

Convert array to implode value using ci

I have been getting value array and convert implode value comma separate ? Model: Controller: Array value: View json print value: Result: I need this value: Answer When there is only one field in the SELECT, an implode does nothing. You need to collect the data and then return the imploded data.

SQL- query processing-index nested loop join

when we are using Index nested loop join, is it index on joining column should be only for the inner table or it can be on the inner or outer table? Answer A nested loop join is looping through the outer table and then looking up a value in the inner table. The primary use of an index would be