SUbba LIngam Posted July 29, 2014 Report Share Posted July 29, 2014 this was the same argument that came up last week with an architect..I defended it saying both are same performance(and its true they are same at least it is justified based on the execution plan) but it is advisable because its more clear to the second eye what the intention is and sometimes not in works weirdly based on the column property..grammar thapul unte kshminchu asal ardam lekunte marninchu grammar tappul vethikentha matter ledu le mayya naa daggara,,,,,,, cheers Link to comment Share on other sites More sharing options...
SUbba LIngam Posted July 29, 2014 Report Share Posted July 29, 2014 select a.* from table a where LENGTH(REPLACE(TRANSLATE(a.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) > 0 and not exists ( select 'x' from table b where a.user=b.user and LENGTH(REPLACE(TRANSLATE(b.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) <= 0 ) idi try chesi cheppu vay, maa maanana memu kottinchukuntunnam kani nuvvu matram em cheppatle Link to comment Share on other sites More sharing options...
tejak123 Posted July 29, 2014 Author Report Share Posted July 29, 2014 select a.* from table a where LENGTH(REPLACE(TRANSLATE(a.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) <= 0 and exists ( select 'x' from table b where a.user=b.user and LENGTH(REPLACE(TRANSLATE(b.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) > 0 ) .// Chesthunna bhaiya.. i am 100 times more tensed.. first job bhaiya.. koppadaku Link to comment Share on other sites More sharing options...
ChampakDas Posted July 29, 2014 Report Share Posted July 29, 2014 edhi correct ye kada va its working I tried SELECT * FROM UserProduct WHERE PRODUCT NOT LIKE '%[0-9]%' correste...aithe this works.... select distinct USER from table_name where PRODUCT_BOUGHT_CATEGORY not like '%[0-9]%' Link to comment Share on other sites More sharing options...
tejak123 Posted July 29, 2014 Author Report Share Posted July 29, 2014 error vasthundhi bhaiya Link to comment Share on other sites More sharing options...
ChampakDas Posted July 29, 2014 Report Share Posted July 29, 2014 Link to comment Share on other sites More sharing options...
JollyBoy Posted July 29, 2014 Report Share Posted July 29, 2014 select a.* from table a where LENGTH(REPLACE(TRANSLATE(a.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) <= 0 and exists ( select 'x' from table b where a.user=b.user and LENGTH(REPLACE(TRANSLATE(b.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) > 0 ) .// Chesthunna bhaiya.. i am 100 times more tensed.. first job bhaiya.. koppadaku kopam endi va.. em using SQL ki Link to comment Share on other sites More sharing options...
ChampakDas Posted July 29, 2014 Report Share Posted July 29, 2014 joke ga ana ne gussa kaku grammar tappul vethikentha matter ledu le mayya naa daggara,,,,,,, cheers Link to comment Share on other sites More sharing options...
puli_keka Posted July 29, 2014 Report Share Posted July 29, 2014 bujja TS nuvvu HDInsight annav kada.. SQl azure using aa Link to comment Share on other sites More sharing options...
tejak123 Posted July 29, 2014 Author Report Share Posted July 29, 2014 annay nenu sarigga substitute cheyyalekunna values.. select a.* from table a where LENGTH(REPLACE(TRANSLATE(a.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) <= 0 and exists ( select 'x' from table b where a.user=b.user and LENGTH(REPLACE(TRANSLATE(b.PRODUCT_BOUGHT_CATEGORY, ’0123456789′, ‘a’), ‘a’, NULL)) > 0 ) .// Chesthunna bhaiya.. i am 100 times more tensed.. first job bhaiya.. koppadaku Link to comment Share on other sites More sharing options...
tejak123 Posted July 29, 2014 Author Report Share Posted July 29, 2014 bujja TS nuvvu HDInsight annav kada.. SQl azure using aa.// Yes.. :) Link to comment Share on other sites More sharing options...
puli_keka Posted July 29, 2014 Report Share Posted July 29, 2014 error vasthundhi bhaiya user anedhi nee column name aithe [USER] ivvu ..user anedhi reserved keyword.. error emi vasthundo vey ikkada Link to comment Share on other sites More sharing options...
puli_keka Posted July 29, 2014 Report Share Posted July 29, 2014 SELECT DISTINCT [USER] FROM Products WHERE [USER] NOT IN ( SELECT DISTINCT [USER] FROM Products WHERE PRODUCT_BOUGHT_CATEGORY LIKE '%[0-9]%' ) idhi work aithe we can see performance improvements.. Link to comment Share on other sites More sharing options...
tejak123 Posted July 29, 2014 Author Report Share Posted July 29, 2014 cannot recognise input near "select" "from " in expression ani vasthundhi Link to comment Share on other sites More sharing options...
pachimirchi Posted July 29, 2014 Report Share Posted July 29, 2014 DECLARE @t TABLE (userid CHAR(1),prod_category VARCHAR(15)) INSERT @t SELECT 'A','YUI' UNION ALL SELECT 'B','JHI' UNION ALL SELECT 'C','WER' UNION ALL SELECT 'E','123' UNION ALL SELECT 'A','456' UNION ALL SELECT 'C','DFG' UNION ALL SELECT 'B','CFT' UNION ALL SELECT 'E','365' UNION ALL SELECT 'S','ASD' UNION ALL SELECT 'H','HJK' UNION ALL SELECT 'E','ASD' SELECT DISTINCT userid FROM @t WHERE userid NOT IN( SELECT DISTINCT userid FROM @t WHERE ISNUMERIC(prod_category)=1 ) AND ISNUMERIC(prod_category)!=1 Link to comment Share on other sites More sharing options...
Recommended Posts