Ps: tried using an IF or a case and implementation, but both can only return a value or a string, unable to return multiple field values
CodePudding user response:
First write your hair up, including how you think,CodePudding user response:
If my filter condition is e-books, educations, Chinese, so I'm going to select all educations, language classes of e-books and paging processing: SQL statements to write is a bit poorSELECT
*,
IF
(
TST. Id=2,//2 ebook
(the SELECT t_ebook book_name FROM t_ebook where t_ebook. Id=1),
(the SELECT t_video_info video_name FROM t_video_info where t_video_info. Id=1)
) as the 'result'
The FROM
T_study_type as TST,
T_grade,
T_ebook,
T_video_info,
T_subject
Where
TST. Id=2
And
T_grade. Id=5//5 said in a
And
T_subject. Id=1//1 language
CodePudding user response:
If there is no, you can write two SQL, determine what type, if it is the ebooks will check selectEbook (returning to the List), check if the video is video selectVideo (returning to the List), don't choose type, it two methods are carried out and then put the two List in a resultList returnsCodePudding user response:
This also calculate a solutionCodePudding user response:
Why not now determine the type in the Java code to perform different conditions