[Solved] Data Base Query [closed]

If I understood your question properly, then query should be like this SELECT state_name,district_name from TableName WHERE id=’jk-01′ //you can have your specific id here 1 solved Data Base Query [closed]

[Solved] SQL Data models

for 1.2 you will need one more table which will hold task and items relation ship for example Table : Task_Item_Rel {TaskID,ItemID} whenver you want item related to a particular task simply have a query with joins between task,item and Task_Item_Rel solved SQL Data models

[Solved] Group by and calculation from value on the next row

You can easily calculate the % difference using lag() select name, date, number, Cast(((number * 1.0) – Lag(number,1) over(partition by name order by date))/ Lag(number,1) over(partition by name order by date) * 100 as int) from table solved Group by and calculation from value on the next row

[Solved] Create hierarchical data from 2 tables

Has nothing to do with recursion. Basically you can get what you want with UNION SELECT ProdId as MarkerId, ProdName as MarkerName, NULL as MarkerParentId from t1 UNION ALL SELECT OrdId as MarkerId, OrdName as MarkerName, ProdId MarkerParentId from t2 ORDER BY MarkerId, MarkerParentId 3 solved Create hierarchical data from 2 tables

[Solved] SQL query to get list of months start from current month

look at this query. it’s just for demonstration, DECLARE @YEAR INT SET @YEAR = (SELECT YEAR(GETDATE())) DECLARE @MONTH INT SET @MONTH = (SELECT MONTH(GETDATE())) DECLARE @DT TABLE(ID INT, MONTHNAME NVARCHAR(20)) INSERT INTO @DT SELECT NUMBER AS ID, DATENAME(MONTH, CAST(@YEAR*100+NUMBER AS VARCHAR) + ’01’) AS MONTHNAME FROM MASTER.DBO.SPT_VALUES WHERE TYPE = ‘P’ AND NUMBER BETWEEN @MONTH … Read more

[Solved] How can i modify this sql for execute?

one update wallet SET coin=coin-(least(coin,500)) where userId=101; or the other maybe update wallet SET coin=case when coin < 500 then 0 else coin-500 end where userId=101; solved How can i modify this sql for execute?

[Solved] Can we call a private procedure of a package from another package and can we call database procedure from a private package

If by private, you mean a procedure that’s defined in the package body and not exposed in header, then no. The other package won’t be able to “see” the procedure. SQL> CREATE OR REPLACE PACKAGE foo AS END; — No “public” procedures/functions 2 / Package FOO compiled SQL> CREATE OR REPLACE PACKAGE BODY foo 2 … Read more

[Solved] Creating a database to query

well, as stated in the comments, your question is very unspecific, but i – as a fan of php and mysql – would say that those are ONE good answer to create a website like that. you can get free software suites to help you with this endeavour, start experimenting on your home computer, learn … Read more