Skip to content
Advertisement

Tag: select

Optional variable in Graphql

I have a graphql query like this: when i run this it expects a id as variable. How can I make that variable optional? It should display all results when no id is given Answer There’s no way that I’m aware to declare a variable as optional but also have it ignore the rest of the expression in the way

Simplification of SQL Query

SQL is not my specialty. I have a working query that accomplishes what I need it to, but I know there has got to be a cleaner way of accomplishing my goal. The query should return: – Name – Date of …

MySQL Workbench – SELECT is not valid at this position with this server version when using CASE WHEN statement [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 11 months ago. Improve this question When implementing a basic CASE WHEN statement in MySQL Workbench, I am getting the following error “SELECT is not valid at this

Select info from row to another row

I have this select on a view: And get this: And I want that the last row be like this: That is, the values of all columns equal to the other rows, except column ‘C’ and column ‘D’. The value of column D is obtained from T2.D How can I do? Thanks. Answer Without any sample data to use I

How can I select data from last 13 months?

I have two tables with exactly same structure Now I need to ‘union all’ these two tables and I want only last 13 month data every time I run below query I have to run this every month and need only last 13 month data. How can I apply the filter? I have a date column ‘date’ in both the

Need help in framing SQL Query

TABLE-1 OrderDate CustomerNo ProductId Quantity 2021-03-01 1 1 10 2021-03-01 1 3 20 2021-03-02 1 2 15 2021-03-02 1 3 10 2021-03-03 1 1 10 2021-03-03 1 5 25 This table also contains data for other customers also Customers 2,3,4 … TABLE-2 ProductId ProductName 1 P1 2 P2 3 P3 4 P4 5 P5 Products are not Fixed, may be

Advertisement