Skip to content

Tag: sql-server

How can I get a query displayed monthly with a subquery

I have a query here with a subquery. This shows me the complete result for the year. How do I get it to be displayed to me on a monthly basis. I’ve tried a few things but always get an error message Here my query The result should look like this: Thank you Answer You can probably simplify this by

SQL for Calclate sum of Sales At particular time every day

Order Table.Reprpesents Order Date and Created is time at which record was inserted The laltest record in this table is at(Created value) – 05:17:38.710 Output – 2021-12-26 05:17:38.710 At this time on 26th i.e. today’s date the sales was At the same time I want to know the sales on 25th I w…

Finding who called who

I have these two tables. Subscriber table contains SubscriberID and his Phone number. NetworkP2P contents SubscriberID, to who he has called AddresseeNumber and when the call started, ended. Example data: Subscriber NetworkP2P Not all Phone numbers match the ones that Subscribers have. How would I approach th…

Migrating from sql to mysql

I want to transfer a database that I created with sql server with the information in mysqle. An example sql file is as follows No connection to the database should be interrupted during this migration. SQL File Answer Given the length of the script, it would be best to you use an online converter. A good choi…

Case statements with Join on lookup

I have a big table with some columns having lookup values. I want to create a description column for each lookup column and populate them with description from lookup table. Here is one example main table id1 id2 id3 1 2 3 1 3 4 look up table code id desc id1 1 id1-desc1 id2 2 id2-desc2 id2 3 id2-desc3