I have following function in my model to select records as per the user ID in the session. public function getOfficer() { $usr = $this->session->userdata(‘id_user’); $userArray = $…
Tag: sql
Drag and Drop not working with external monitor [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I’m working on a small project for my studies. It’s the first …
Codeigniter MySQL select max using varchar type value
I want to select max auto_no from the following varchar type column in my codeigniter model +————+ | auto_no | +————+ | 2020-00821 | | 2020-00822 | | 2020-00823 | | 2020-00824 | | …
(SQL Server 2017) I get error Msg 8152 and I don’t know why
I have no idea why, but I am getting the error Msg 8152 (in SQL Server 2017) after trying to insert something like into the table The output I get is Msg 8152, Level 16, State 14, Line 1 String or binary data would be truncated. Thanks in advance for your help! Answer You need to define a length for
how to create pl sql function to Checking if data exists in database or not
I am trying to create a function that tells whether data exist in database or not. Trying to solve this using cursor if data exist then data will be fetched from database and value of temp will be TRUE otherwise data would not be fetched from DB and it will set value of temp to false. But when I compile
Is there a way to count all the trailing zeros in a column in MySQL?
I am looking to find out if there is a way to count the number of trailing zeros in a column. The column is made up of a maximum of 13 numbers as shown below and I want to count all the zeros before …
Is a cursor/recursion the only possible option here? Set based logic based on certain lag conditions
I’m using SQL Server, I have a table with 3 columns (timeseries) data, with date, hour beginning, AwardStatus. The award status for the most part is randomly generated. There can be two options, …
MySQL SELECT only rows where tbl_col equal to this and that
I am struggling a bit with my SQL query. This is the query i have now, and it works as is, but i want to add some more to it. In the mysql table, there is a column that is named “type”. I want to filter the rows and get the rows with the string “sms” or the string “email”
Subquery error calculating Free throw statistics
trying to incorporate the query titled “free throws made” as a subquery into the query below it titled “FreeThrowPercByGame” but getting an error. Both work independent of each other in Google Big …
TSQL – Parent Child (1 to zero/many) Grouping/Aggregation
Code (Sample Data Staging): Description: @Emp is the sample Employee table (Unique Employee records). EId = Employee Id FN = First Name LN = Last Name @EmpPhCont is the sample Employee Phone Contact table (Each Emp from @Emp table can have zero, one, or multiple phone numbers here – unique by Emp/Type).…