« first day (2800 days earlier)      last day (1518 days later) » 

7:12 AM
Hi
all
can some one let me know what is the usage of number in where condition
select name, no from employee1 e1 where 1=(selec count(distinct(e2.sal) from employee e2 where e2.sql >= e1.sql)
 
good question let me check
 
ok thanks
 
good morning
 
query looks fine @Pani any errors?
 
what are you expecting to do @Pani
 
7:26 AM
how the select query is getting the data based on the condition
?
select name, no from employee1 e1 where 1(.......)
 
let me rephrase my question
 
ok
 
can you make a dbfiddle.uk and create the neccesary tables/query then give me ur desired result opposed to what you have now
 
morning
 
for me it returns all the rows in the table :D
equating to 1 returns all row while equating it to some other int will return none
@Tomm why would someone want such a query?
 
7:32 AM
thats exactly why i want the fiddle. it makes little to no sense to me. + I am at work, so i cba creating my own fiddles
 
@Pani what is the expected result of the query?
 
oracle?
 
yes
 
the fiddle says ur inserts contain invalid chars
anyways what is ur expected result. I am still not sure what you are trying to do
 
7:48 AM
@Pani
select name, no from employee e1 where 2=(select count(distinct(e2.sal)) from employee e2 where e2.sal >= e1.sal)
 
???
 
@Pani what do you want to do with that query?
 
8:10 AM
Morning
 
Morning
just did a quizz test on python for a recruiter
 
how did it go
 
11/20 for 20 questions on 20 mn
I hate to have a timer, it is kind of stressing
 
ugh timers are the worst
 
@Tomm indeed
 
8:21 AM
idk what the term is
but i hate snapshot tests anyways
 
but ok, eventually, it could have been worse but it could have been better
 
u cant judge someone on a 1 moment thing
someone either needs time, or isnt in the right headspace and ur already down
showing a git and asking for example a demo or something does so much more
 
i just wanted to know how the query works
?
 
@Pani your query is not well written
try to explain to us in simple terms what you want to do
 
yeh it would be nice if we knew what you expected
 
8:38 AM
select name, no from employee1 e1 where 1=(selec count(distinct(e2.sal) from employee e2 where e2.sql >= e1.sql)

Let's try this:
You create a data frame of `employee` (e1).
You then create another data frame of `employee` (e2).
You then join the two data frames where `e1.sql` is greater or equal (>=) to `e2.sql`.
You then aggregate the distinct `e2.sal` to get the count of them.
You return the rows where that count is only equal to 1.
From those rows, you only return `name` and `no` columns
That should explain it while being completely wrong at the same time :D
Any questions @Pani, ask @Tomm or @AndyK
 
 
1 hour later…
10:02 AM
/o
 
10:13 AM
\o
 
at least its friday
 
Tell me about it
 
you got any weekend plans?
 
10:41 AM
First weekend by myself, don't have to visit anyone or go anywhere
I'm hoping to relax by a good 60%
You?
 
that sounds good, i have a yugioh tournament tomorrow, then I have basketball on sunday
 
Oh shit, best o'luck
 
thanks, I haven't entered any tournaments so far this season so I still need to qualify for the European championships :D
season started in August :D
 
 
4 hours later…
Sly
2:40 PM
Hello everyone
 
@Sly hey
 
Sly
@AndyK got a problem when creating a view with NULL column names and cant figure out how to cast the columns without getting an error.
let me share the query @AndyK
@AndyK the error is occurring once i try the cast function at the end of the query below
CASE
  WHEN (
    CASE
      WHEN YY_RP_CI          IS NULL
      OR YY_RP_CIS           IS NULL
      OR YY_RP_DD    IS NULL
      OR HR_S_OR IS NULL
      OR HR_J_I       IS NULL
      OR HR_PO                  IS NULL
      OR HR_DD          IS NULL
      THEN '0_One_NULL_field'
      ELSE '1_No_Nulls'
    END)= '1_No_Nulls'
  AND (
    CASE
      WHEN YY_Band IS NULL
      THEN '0_Missing_YY_Band'
      ELSE '1_Got_YY_Band'
    END)= '1_Got_YY_Band'
  THEN
    -- We continue here if no items are emtpy.  If some are, we skip to the ELSE at the bottom of the code
@AndyK i know its a humongous case statement if its too much to go through its okay i understand
 
this gave me the chills
 
@Sly there is too much. I'm going to have a call in 10mn. Try to make it as simple as possible for those who have time
to help you
 
Sly
@AndyK understood
 
2:53 PM
this is working for me
 
Sly
@Tomm I could do that but i needed something in this case statemet
at the end of the case statement
 
do u have time to throw this all in a dbfiddle.uk
 
Sly
as in create dummy table with this case statement?
 
Indeed
cause i get the cast working in normal queries
 
Sly
okay . let me try it to create it
 
3:46 PM
Im going home, sorry @Sly
maybe someone else will be on, but my weekend is waiting for me
 
@Sly pls, I will have a look
 
Sly
4:02 PM
@AndyK Thanks
@Tomm have a good weekend
 
 
1 hour later…
5:14 PM
see ya
 
 
2 hours later…
6:54 PM
Hi guys
I have a zoo table with following fields : ZooName,City,AnnualVisitors,CountryLocation
Animal : AnimalId,Species,ZooName,Gender
Species are Lion,Tiger,Horse,Peacock etc..
Now i want to do this : List the Zoos that have both tigers and lions
So it would be simple join on both the tables and condition like this right :
Where Animal.Species in (‘tiger’,’lion’)
Right guys?
 

« first day (2800 days earlier)      last day (1518 days later) »