Skip to content
Advertisement

Tag: mysql

Return records of one value and not in other values

Apologies for asking such simple question but here I am getting trouble while getting records from single table, my table contains records which have different values in prod_code for similar product_number. I want records of such product_number which have specific prod_code, and not others. For example from below table I need a records which have only prod_code with value CIOFB1

MYSQL: Can’t update table in stored function/trigger

I have a table called “report” I am trying to create a trigger for in case insert a state with value “failed” for the ip_element “10.66.16.55” and path “/dev/map/4-4”, the state change to “ok” I get the next error: Answer You cannot update the table on which you have a trigger (as the error message states). Instead, you have to

Create a new record for every user in a database based on a column

I have a MySQL database with a user table, after a new requirement I had to create a new table called social_media and from now on every new user will be created with a social_media_id column that holds a reference to their social media. I want to update my database so that every user that didn’t had a social media

Creating and using an SQL variable after some set text

I’m needing to set some text into a field within a row, and use a SQL variable as part of that text. I’m then using this sql statement in a bash script. I have I believe I created the variable correctly I then need to use this variable as follows However its not working and is giving me errors about

MySQL procedure not working with both select and delete

I created a procedure to get a vehicle id from the vehicle table using vehicle number input, then delete the booking record for that vehicle id, and at last to delete the entry in the vehicle table… But when creating the procedure I get an error at line 7 saying Error Code: 1064. You have an error in your SQL

Null values affecting case logic

I am having a problem in the following query. In the AR column there are some null values due to the left join of the wbr_global.raw_station_extended_attribute. To fix this I added a case to default to 0 if it is null. The issue this is causing is in my next case statement for assinging a station size. All the null

Advertisement