Skip to content
Advertisement

Tag: sql

Cant understand my syntax mistake in MySQL CREATE FUNCTION

This is my code and I can not find the mistake! I am trying to create a function that multiplies a value to de input parameter and returns that result! It should not be that difficult but I am not finding my sintaxt mistake The mistake says: error code 1064 Answer The DECLARE has to be before the code. I

Pyspark, iteratively get values from column containing json string

I wonder how you would iteratively get the values from a json string in pyspark. I have the following format of my data and would like to create the “value” column: id_1 id_2 json_string value 1 1001 {“1001”:106, “2200”:101} 106 1 2200 {“1001”:106, “2200”:101} 101 Which gives the error Column is not iterable However, just inserting the key manually works,

Where clause if true would not show at all

Have table where are two columns – client_id, content every client have +- 50 content rows. In WHERE i have this clause – where content NOT IN (‘2′,’3′,’4’) In result shows same clients but without rows where are ‘2’,’3′,’4′. I need if found one client with content ‘2’,’3′,’4′ dont show this client completely Answer NOT IN only removes the rows

Need to fix sorting order by name and price

I am working on school listing project. I have created database name is school and under I add new table name is schoollist Here I have many school. I have added few column on it bellow the list of column. For the above table i want to search Wright Oslo and after the result should be Wright oslo school and

Lower bound for Postgres integer type out of range?

Per Postgres documentation, an integer type is defined between -2147483648 and +2147483647. I thought that these boundaries were inclusive, but if I try: an Integer out of range error is raised. The upper bound seems to be casted properly: And if I increase the lower bound by one it works fine as well: The same result is applied to smallint.

Socket closed inside XWM

I have an SQL exception inside a piece of code that works under and scheduled process every day. The patch of code is as follows: There should be no connection problems with this but today i have a socket closed exception in my log in: Here is my log: Any thoughts about why this could happen? First time this schedule

How to show/fetch amount of posts, comments etc a user has made

I want to show the users the amount of posts, comments etc they have created in their profile section, just like any other forums that exist. I am doing this with php and MYSQLI. Post table: I have tried to add another column to the post table and increment its value by 1 each time the user makes a post

Count records based on a repeating field while returning other values

I have the following query and a sample output uid creation_date activity_date feature1 feature2 feature3 id1 date1 date1x asdf sfsdfd sdsdf id1 date1 date1x asdf fasaa asdas id1 date1 date1x asdf sfsdfd asdas id1 date1 date1x aadf afdsf adfad id2 date2 date2x aadf afdsd asdas id2 date2 date2x aadf adsfsdf sdsdf id2 date2 date2x asdas afdsf adfad id3 date3 date3x

Advertisement